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 jayvdb
Recipients jayvdb
Date 2015-10-29.04:53:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446094420.64.0.595919822106.issue25503@psf.upfronthosting.co.za>
In-reply-to
Content
inspect.getdoc's helper _finddoc raises an AttributeError on encountering a property, which is silently discarded.

>>> class Foo(object):
...     @property
...     def foo(self):
...         """foobar."""
...         return 'foo'
... 
>>> class Bar(Foo):
...     @property
...     def foo(self):
...         return 'bar'
... 
>>> import inspect
>>> inspect.getdoc(Foo.foo)
'foobar.'
>>> inspect.getdoc(Bar.foo)
>>>

How I came upon this was doing static code analysis, and the f.fget on line 522 here looks very wrong.

http://bugs.python.org/review/15582/diff/14140/Lib/inspect.py

This code dedicated to supporting `property` does not work because of that, but also because a property is also a data descriptor so the 'property' branch is never executed.

>>> inspect.isdatadescriptor(property())
True
History
Date User Action Args
2015-10-29 04:53:40jayvdbsetrecipients: + jayvdb
2015-10-29 04:53:40jayvdbsetmessageid: <1446094420.64.0.595919822106.issue25503@psf.upfronthosting.co.za>
2015-10-29 04:53:40jayvdblinkissue25503 messages
2015-10-29 04:53:39jayvdbcreate