[Python-ideas] feature to make traceback objects usable without references to frame locals and globals

Antoine Pitrou solipsis at pitrou.net
Mon Jun 28 16:10:18 CEST 2010


On Mon, 28 Jun 2010 15:29:25 +0200
"M.-A. Lemburg" <mal at egenix.com> wrote:
> Antoine Pitrou wrote:
> > On Mon, 28 Jun 2010 13:14:21 +0200
> > "M.-A. Lemburg" <mal at egenix.com> 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:
> 
> http://www.egenix.com/products/python/mxBase/mxProxy/
> http://www.egenix.com/products/python/mxBase/mxProxy/doc/#_Toc162774452

Well, if some features of mxProxy are useful, perhaps it would be worth
integrating them in the stdlib.

Regards

Antoine.





More information about the Python-ideas mailing list