This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients
Date 2007-03-23.21:51:18
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Attempting assignment to a readonly attribute raises an Attribute error for pure Python attributes but raises a TypeError for C readonly attributes.  I think the AttributeError is the correct exception.



>>> class A(object):
...	_x = []
...
...	@property
...	def x(self):
...		return self._x
...	
>>> a = A()
>>> a.x = None

Traceback (most recent call last):
    a.x = None
AttributeError: can't set attribute




>>> def f():
...	yield None
>>> g = f()
>>> g.gi_frame = None

Traceback (most recent call last):
    g.gi_frame = None
TypeError: readonly attribute
History
Date User Action Args
2007-08-23 14:52:44adminlinkissue1687163 messages
2007-08-23 14:52:44admincreate