On Mon, 28 Jun 2010 15:29:25 +0200 "M.-A. Lemburg" email@example.com wrote:
Antoine Pitrou wrote:
On Mon, 28 Jun 2010 13:14:21 +0200 "M.-A. Lemburg" firstname.lastname@example.org wrote: >
BTW: I wonder why proxy objects don't provide a direct access to the weakref object they are using. That would make keeping that extra variable around unnecessary.
Probably because the proxy would then have an additional attribute which isn't on the proxied object. Or, worse, it could also shadow one of the proxied object's existing attributes.
That's a very weak argument, IMHO. It all depends on the naming of the attribute.
What name do you suggest that isn't cumbersome or awkward, and yet doesn't present any risk of conflict with attributes of the proxied object?
We've used such an approach on our mxProxy object for years without any problems or naming conflicts so far:
Well, if some features of mxProxy are useful, perhaps it would be worth integrating them in the stdlib.