Vincent Pelletier plr.vinc...@gmail.com added the comment:
This change causes the following behaviour:
import inspect
class B(object):
... def f(self):
... pass
...
inspect.getmembers(B, inspect.ismethod)
[]
While I would expect the result to contain f:
inspect.ismethod(B.f)
True
Vincent Pelletier plr.vinc...@gmail.com added the comment:
Sorry, I forgot to mention I'm using python2.7 .
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
Antoine Pitrou pit...@free.fr added the comment:
Thanks for noticing. The doc for ismethod() says:
“Return true if the object is a bound method written in Python.”
and the docstring agrees with that:
“Return true if the object is an instance method. [...]”
So the change isn't properly a
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset f824744557ba by Antoine Pitrou in branch '2.7':
Revert part of 13f56cd8dec1 (issue #1785) to avoid breaking getmembers() with
unbound methods.
http://hg.python.org/cpython/rev/f824744557ba
--
Antoine Pitrou pit...@free.fr added the comment:
I've backed out the part of the changeset that fixed getmembers(), so the old
behaviour is restored. Other parts of the changeset (that e.g. fixed pydoc)
have not been reverted.
--
versions: +Python 2.7, Python 3.3
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 902f694a7b0e by Antoine Pitrou in branch '3.2':
Issue #1785: Fix inspect and pydoc with misbehaving descriptors.
http://hg.python.org/cpython/rev/902f694a7b0e
New changeset b08bf8df8eec by Antoine Pitrou in branch
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 13f56cd8dec1 by Antoine Pitrou in branch '2.7':
Issue #1785: Fix inspect and pydoc with misbehaving descriptors.
http://hg.python.org/cpython/rev/13f56cd8dec1
--
___
Antoine Pitrou pit...@free.fr added the comment:
Now fixed in all 3 branches.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
Éric Araujo mer...@netwok.org added the comment:
Great stuff.
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
___
Antoine Pitrou pit...@free.fr added the comment:
Updated patch for 3.2.
--
stage: - patch review
versions: +Python 3.2 -Python 2.6
Added file: http://bugs.python.org/file23975/inspect-and-pydoc-bug2.patch
___
Python tracker rep...@bugs.python.org
Antoine Pitrou pit...@free.fr added the comment:
Updated patch that adds a test for classifying builtin types (checks that
``inspect.classify_class_attrs(type)`` does not throw as in issue13581).
--
___
Python tracker rep...@bugs.python.org
Changes by Antoine Pitrou pit...@free.fr:
Added file: http://bugs.python.org/file23976/inspect-and-pydoc-bug3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
Changes by Eric Snow ericsnowcurren...@gmail.com:
--
nosy: +eric.snow
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
___
Python-bugs-list
Changes by Meador Inge mead...@gmail.com:
--
nosy: +meador.inge
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
___
Python-bugs-list
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
The 'type' object now has the same issue: __abstractmethods__ appears in
dir(type) but type.__abstractmethods__ fails with an AttributeError.
See issue13581
--
nosy: +amaury.forgeotdarc
___
Mark Lawrence breamore...@yahoo.co.uk added the comment:
I can't apply the patch to any current SVN version.
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
Changes by John Trammell johntramm...@gmail.com:
--
nosy: +jotr
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
___
Python-bugs-list
Changes by Floris Bruynooghe floris.bruynoo...@gmail.com:
--
nosy: +flub
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1785
___
___
Facundo Batista [EMAIL PROTECTED] added the comment:
Really don't know why this was assigned to me...
--
assignee: facundobatista -
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1785
___
Changes by Sean Reifschneider [EMAIL PROTECTED]:
--
assignee: - facundobatista
keywords: +patch
nosy: +facundobatista
priority: - normal
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1785
__
Antoine Pitrou added the comment:
For the record the same problem also happens with toscawidgets.
from toscawidgets.widgets.forms import validators
help(validators)
Traceback (most recent call last):
File stdin, line 1, in module
File /usr/lib/python2.5/site.py, line 351, in __call__
Antoine Pitrou added the comment:
Here is a (hopefully complete) patch against both pydoc and inspect. It
fixes one more bug compared to the previous one (descriptors can also
have a special __getattr__ in addition to __get__, which gave problems
when trying to access __classobj__).
Added file:
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
Guido van Rossum added the comment:
Please submit a patch.
--
nosy: +gvanrossum
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1785
__
___
Python-bugs-list mailing list
Dieter Maurer added the comment:
In dm.zdoc (a pydoc wrapper for Zope) I simply filter out all names
returned by dir which cannot be getattred.
But, I am not sure, that this is good enough to be accepted as a patch
(although it already improves upon the current state)
Antoine Pitrou added the comment:
This is my attempt at a patch for this. It fixes inspect.getmembers and
inspect.classify_class_attrs to work with Dieter's example. I hope it
doesn't mess anything else.
As for pydoc, things look a bit more complicated... The annoying thing
is that the logic to
Changes by Antoine Pitrou:
--
versions: +Python 2.6 -Python 2.5
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1785
__
___
Python-bugs-list mailing list
Unsubscribe:
27 matches
Mail list logo