New submission from Anthony Flury:

Consider the following code in Python2.7 & Python3.5 

    import inspect
    
    class a(object):
         def m(self):
             pass

in Python 2.7 
    
    inspect.ismethod(a.m) returns True

in Python 3.5
 
    inspect.ismethod(a.m) returns False

Not sure which is `correct`, but I can see the Python3.5 result causing some 
issues with automatic code documenters. 

I have code which will break under Python3.5 with this - my code performs 
static analysis of code, detecting functions, classes, attributes, and also 
traversing the mro to find inherited methods etc. Amongst other things this 
code identifies methods on classes, without instantiating those classes.

This may simply require a documentation change to explain the difference on 
Py3.5 - rather than a code change.

----------
components: Library (Lib)
messages: 273955
nosy: anthony-flury
priority: normal
severity: normal
status: open
title: inspect.ismethod returns different results on the same basic code 
between Python2.7 Python3.5
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27901>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to