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.
Logged In: YES user_id=80475 Confirmed the script behavior in Py2.4. The interactive prompt results are not consistent It returned True the first time I ran it and raised a ReferenceError in subsequent attempts.
Logged In: YES user_id=33168 I believe the fix is in Objects/weakrefobject.c, line 358. -1 should be returned, not 1 since an error occurred in proxy_checkref(). I'll try to fix this. If anyone wants to steal it, feel free. :-) Chris, if you could test the fix and report your results, that would be great.