[C++-sig] Re: Custom WeakPtrs and "None"
David Abrahams
dave at boost-consulting.com
Thu Nov 18 01:28:35 CET 2004
haller at ableton.com (Stefan Haller) writes:
> The only problem is that when the object goes away, the "weak pointer"
> on the Python side isn't set to "None". Of course, the wrapped C++ weak
> pointer is set to NULL, but the python variable isn't aware of that
> unless you try to access properties or call methods on it, in which case
> it throws an exception. It would be very nice if a comparison with None
> would return true for a weak pointer that has been set to NULL.
Nothing will do that; how would you know all the places the Python
object is bound to an attribute name or local variable?
It's in the nature of Python. It has "name bindings," not "variable
values."
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
More information about the Cplusplus-sig
mailing list