Looking for assignement operator

Robert Kern robert.kern at gmail.com
Wed Oct 18 12:35:29 EDT 2006


Bruno Desthuilliers wrote:
> Tommi wrote:
> (please don't top-post - corrected)
>>
>> Alexander Eisenhuth wrote:
>>> Hello,
>>>
>>> is there a assignement operator, that i can overwrite?
>>>
>>> class MyInt:
>>> 	def __init__(self, val):
>>> 		assert(isinstance(val, int))
>>> 		self._val = val
>>>
>>> a = MyInt(10)
>>>
>>> # Here i need to overwrite the assignement operator
>>> a = 12
>>>
> 
>> Could the "traits" package be of help?
>>
>> http://code.enthought.com/traits/
> 
> How could it help ?

It doesn't. (I am an Enthought developer.)

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list