A Suggestion for Python Colon Syntax

Alex Martelli aleaxit at yahoo.com
Sat Dec 23 12:39:29 EST 2000


"David Abrahams" <abrahams at mediaone.net> wrote in message
news:CF316.26760$1t.879107 at typhoon.ne.mediaone.net...
    [snip]
> >     x = x + y
> >
> > could end up generating multimegabyte temp arrays while
> >
> >     x += y
> >
> > need not.  That is, for them it wasn't "just another way" to write the
> > former; it offers crucially different semantics.
>
> Yes! Any chance of getting this capability for extension classes?

Not sure what you mean by this question.  Both Python-written
classes (by implementing __iadd__) and extension types that are
written in C (by appropriate flags in their method tables) can do
in-place additions (&c).  What are 'extension classes'...?  Anyway,
this stuff is underdocumented, but, study the sources... it works.


Alex






More information about the Python-list mailing list