[New-bugs-announce] [issue1785] "inspect" gets broken by some descriptors

Dieter Maurer report at bugs.python.org
Thu Jan 10 18:39:32 CET 2008

New submission from Dieter Maurer:

The inspect functions "getmembers(cls)" and "classify_class_attrs(cls)"
require that for a class *cls* each name in "dir(cls)" can be retrieved
by "getattr(cls, name)". While this holds for usual class attributes, it
may well fail for descriptors (descriptors set by 'zope.interface' are a
real world example for this). Attached it as small script that
demonstrates the problem.

The bug affects 'pydoc' and the built in 'help' (which is in fact
'pydoc.help'). While 'pydoc' and 'help' do not break completely, they
can not present meaningful information for classes with some descriptors

components: Library (Lib)
files: inspectBug.py
messages: 59675
nosy: dmaurer
severity: normal
status: open
title: "inspect" gets broken by some descriptors
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file9117/inspectBug.py

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list