[Python-3000] Betas today - I hope

Antoine Pitrou solipsis at pitrou.net
Thu Jun 12 17:04:56 CEST 2008


Hello all,

> Whether they'll care about this issue of course depends on whether
> they need overloaded operators and other special delegations to be
> delegated transparently.

Perhaps it may happen more implicitly than people think. Especially
for methods like __bool__, __str__, __iter__...
After all special methods are special in that they can get called
behind your back in a number of situations, and those are regularly
growing :)

Of course one can also argue that the __bool__ and the __str__ of
a proxy doesn't have to have the same semantics as the __bool__
and the __str__ of the proxied object. The counter-argument here
(and I agree with it) was that most people want a transparent proxy
behaviour, and those who don't want, want a nearly-transparent proxy
behaviour, i.e. they want to start from a transparent proxy
implementation and then override the few methods whose behaviour
they want to special-case.

Another potential (but perhaps far-fetched) motivation is that a proxy 
implementation in the stdlib could be tweaked or rewritten in C, and
thus be much quicker that the naive implementation most people (including
me :-)) might come up with.

Regards

Antoine.




More information about the Python-3000 mailing list