Message21256
The following code will cause interesting errors:
from weakref import proxy
class a: pass
bool(proxy(a()))
Entered at a prompt, this will not cause a
ReferenceError until another statement is entered (and
will instead return True or 1) in both 2.3 and 2.2.
Run as a script, this will return True and cause a
fatal error in 2.3, but will return 1 and otherwise
exhibit no strange behaviour in 2.2 (even with
additional code accessing the return value).
The equivalent code written using ref rather than proxy
works as expected: bool(ref(a())()) returns False and
creates no errors. |
|
Date |
User |
Action |
Args |
2007-08-23 14:22:49 | admin | link | issue978308 messages |
2007-08-23 14:22:49 | admin | create | |
|