Message31640
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 |
|
Date |
User |
Action |
Args |
2007-08-23 14:52:44 | admin | link | issue1687163 messages |
2007-08-23 14:52:44 | admin | create | |
|