[Python-Dev] Are property descriptors intended to be immutable?

Curt Hagenlocher curt at hagenlocher.org
Fri Feb 6 23:44:33 CET 2009


...because they're not quite :).  Should I file this as a bug report?
(I get the same results under 2.6 and 3.0.)

PS C:\Program Files (x86)\CCP\EVE> C:\Python25\python.exe
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class x(object):
...     @property
...     def foo(self): return 1
...
>>> inst = x()
>>> inst.foo
1
>>> x.foo.__init__(lambda self: 2)
>>> inst.foo
2
>>> ^Z

--
Curt Hagenlocher
curt at hagenlocher.org


More information about the Python-Dev mailing list