alias for data member of class instance?

Sean McIlroy sean_mcilroy at yahoo.com
Mon Feb 5 15:07:04 EST 2007


hi all

is there a way to do this ...

class clown:
	def __init__(self):
		self.x = 0
		self.y = ALIAS(self.x) ## FEASIBLE ?

... so that you get results like this ...

krusty = clown()
krusty.x
>> 0
krusty.y
>> 0
krusty.x = 1
krusty.x
>> 1
krusty.y
>> 1

... ? thanks.

peace
stm




More information about the Python-list mailing list