python-dev
[Prev] Thread [Next] | [Prev] Date [Next]
Re: [Python-Dev] [Python-3000] Betas today - I hope Nick Coghlan Mon Jul 14 20:10:32 2008
Michael Foord wrote:
Guido van Rossum wrote:Whether they'll care about this issue of course depends on whether they need overloaded operators and other special delegations to be delegated transparently. We'll have to see how important this is. New-style classes have been around and recommended for a long time -- why haven't people pushed for a proxy class before?It's only in Python 3 that old style classes are going away fully, so up until now you could at least use a classic class to do the proxying.I've written my own proxy classes before that look very similar to this, and there are other proxy classes around that do the same (I thought one was by Phillip J Eby but can't find a reference easily). The last one I wrote was to proxy CPython objects from IronPython via Python.NET...I would prefer it if the proxy class wrapped the return values of inplace operations.
Yeah, the latest version on the issue tracker does that, and allows subclasses to define a return_inplace() method to alter the behaviour (e.g. a weakref.proxy equivalent wouldn't want to wrap the return values so that it can ensure there is always at least one strong reference to the result of the operation).
Since you can also replace the .target attribute with a property to affect how the target object is stored and accessed, it's a reasonably flexible approach.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/alexiscircle%40gmail.com
- Re: [Python-Dev] [Python-3000] Betas today - I hope, (continued)
- Re: [Python-Dev] [Python-3000] Betas today - I hope M.-A. Lemburg
- Re: [Python-Dev] [Python-3000] Betas today - I hope Walter Dörwald
- Re: [Python-Dev] [Python-3000] Betas today - I hope Walter Dörwald
Re: [Python-Dev] [Python-3000] Betas today - I hope Georg Brandl Re: [Python-Dev] [Python-3000] Betas today - I hope Guido van Rossum Re: [Python-Dev] [Python-3000] Betas today - I hope Guido van Rossum
- Re: [Python-Dev] [Python-3000] Betas today - I hope Barry Warsaw
- Re: [Python-Dev] [Python-3000] Betas today - I hope Nick Coghlan
- Re: [Python-Dev] [Python-3000] Betas today - I hope Guido van Rossum
- Re: [Python-Dev] [Python-3000] Betas today - I hope Michael Foord
- Re: [Python-Dev] [Python-3000] Betas today - I hope Nick Coghlan <=
- Re: [Python-Dev] [Python-3000] Betas today - I hope Nick Coghlan
- Re: [Python-Dev] [Python-3000] Betas today - I hope Michael Foord
Re: [Python-Dev] [Python-3000] Betas today - I hope Jim Jewett Message not available Re: [Python-Dev] [Python-3000] Betas today - I hope Nick Coghlan Re: [Python-Dev] [Python-3000] Betas today - I hope Alexandre Vassalotti
- Re: [Python-Dev] [Python-3000] Betas today - I hope Barry Warsaw
- Re: [Python-Dev] [Python-3000] Betas today - I hope Guido van Rossum
- Re: [Python-Dev] [Python-3000] Betas today - I hope Barry Warsaw