|
|
|
|
|
by fusiongyro
5049 days ago
|
|
As I said, you seem to be claiming that Python is a superset of Java, not equivalent to it, and that claim is manifestly false. Errors that are detected in one place and not in another are a manifest difference. Also, Java threads and anonymous classes do not translate directly to Python. |
|
In Python classes are first class objects, and you can easily do anything you could do with Java anonymous classes on the fly. Furthermore Java anonymous classes are usually used as a verbose replacement for a lack of closures. But in Python you can create closures and pass them around. (You do have to do some juggling to mutate variables, but 1 element arrays are only a slight pain to work with.)