[New-bugs-announce] [issue16851] ismethod and isfunction methods error

Wojciech Danilo report at bugs.python.org
Thu Jan 3 17:41:29 CET 2013


New submission from Wojciech Danilo:

Hi! I think this behaviour is bug. Lets concider the following code:

import inspect
class X(object):
    def a(self):pass
    def b(self):pass
    def c(self):pass

print(inspect.getmembers(X, predicate=inspect.ismethod))
print(inspect.getmembers(X, predicate=inspect.isfunction))

In python 2.7, the results are:
[('a', <unbound method X.a>), ('b', <unbound method X.b>), ('c', <unbound method X.c>)]
[]

and in Python 3.2:
[]
[('a', <function a at 0x1b0fd10>), ('b', <function b at 0x1b0fe20>), ('c', <function c at 0x1b160d8>)]

I think, the results from python 2.7 are correct.

----------
components: Library (Lib)
messages: 178964
nosy: wdanilo
priority: normal
severity: normal
status: open
title: ismethod and isfunction methods error
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16851>
_______________________________________


More information about the New-bugs-announce mailing list