Embedding questions
Carel Fellinger
cfelling at iae.nl
Thu Dec 9 18:14:22 EST 1999
Olaf Appelt <tholap at compuserve.com> wrote:
...snipped out request for averloading assignment
> but that would look rather ugly:
> c.assign (a + b)
Or you could go on and really abuse the language
>>>class Currency
>>> def __call__(self, other):
>>> self.value = other
>>>...
which would allow the even uglier
>>> c(a+b)
mind you that now you changed the state of the instance by calling itself:)
--
groetjes, carel
More information about the Python-list
mailing list