Changes between Version 120 and Version 121 of j2p
- Timestamp:
- 09/03/24 09:41:36 (3 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
j2p
v120 v121 375 375 ||I get an error {{{UnboundLocalError: local variable ... referenced before assignment}}} (where ... is a variable name)||Usually this happens if the variable has a name that collides with a method name or library in python, eg "list". Rename the variable so that it is not colliding|| 376 376 ||I get "Python can not handle overloaded methods that use type vars"||This happens if you overloaded a method (you have two or more methods with the same method name) and one of them uses a type var (you have <T> and use T in the method declaration). Python does not support overloading. none of the existing libraries to add this functionality can handle type variables.|| 377 ||It seems the python code uses the wrong values in my lambda expression||There is a subtle but essential scoping difference between java and python. In python, a local variable continues living even if it goes outside of scope and can be changed. If such a change happen, the lambda will use the changed value. Python only keeps the current value if a new variable is created, eg by a method call||