[PEP 203] Augmented Assignment
David Goodger
dgoodger at bigfoot.com
Mon Aug 14 23:56:52 EDT 2000
Here's some food for thought:
Perhaps the cleanest way to implement augmented assignment, syntactically,
would be to add an optional boolean argument to the __add__() etc. hook
functions, resulting in signatures like
def __add__(self, other, augmented):
This could be implemented in a backwards-compatible way as follows: the
interpreter checks for a hook function with the right signature, uses it if
present, then checks for the old-style hook as before. Is this feasible?
Has this approach ever been raised? (I've only been lurking on the
Python-Dev list for a few weeks now. :>)
--
David Goodger dgoodger at bigfoot.com Open-source projects:
- The Go Tools Project: http://gotools.sourceforge.net
(more to come!)
More information about the Python-list
mailing list