Very, very strange problem with properties

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Tue May 4 00:20:58 EDT 2004


Kenneth McDonald wrote:

> class foo:
> 	def __init__(self):
> 		self._x = 3
> 
> 	def __setx(self, val):
> 		print "Calling __setx"
> 		pass
> 
> 	x = property(fget=lambda self: self._x, fset=__setx)

That should be:

    class foo (object):

Tim Delaney




More information about the Python-list mailing list