Message3204

Author leosoto
Recipients leosoto
Date 2008-05-25.20:47:37
SpamBayes Score 0.026997833
Marked as misclassified No
Message-id <1211748477.62.0.331458131255.issue1041@psf.upfronthosting.co.za>
In-reply-to
Content
When accessing an instance attribute defined by a descriptor, any
AttributeError raised by the descriptor itself will be swallowed, and
replaced by the standard AttributeError:

Jython 2.3a0 on java1.6.0_06
Type "copyright", "credits" or "license" for more information.
>>> class Desc(object):
...     def __get__(self, instance, type):
...         raise AttributeError("Custom message")     
... 
>>> class Foo(object):
...     desc = Desc()
... 
>>> Foo.desc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in __get__
AttributeError: Custom message
>>> Foo().desc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Foo' object has no attribute 'desc'
History
Date User Action Args
2008-05-25 20:47:59leosotosetspambayes_score: 0.0269978 -> 0.026997833
recipients: + leosoto
2008-05-25 20:47:58leosotosetspambayes_score: 0.0269978 -> 0.0269978
messageid: <1211748477.62.0.331458131255.issue1041@psf.upfronthosting.co.za>
2008-05-25 20:47:54leosotolinkissue1041 messages
2008-05-25 20:47:51leosotocreate