andrew cooke wrote:
Context - http://docs.python.org/3.0/reference/datamodel.html?highlight=data
model#object.__iadd__

Just a suggestion I thought I'd throw out...  There's a restriction in
the language implementation on exactly what can go the left of an
augmented arithmetic expression.

For example:
a = 3
a **= 2

is ok, but:
class Foo():
...   def __init__():
...     self.a = 3
...   def __ipow__(self, x):
...     self.a **= x
...
Foo() **= 2

Calls return objects and therefore cannot be the target of an assignment, augmented or otherwise. The target of an assignment is a name or collection slot, both of which are grammatical constructs, not objects.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to