[issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2021-08-22 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2021-06-07 Thread Andrei Kulakov

Andrei Kulakov  added the comment:

The data model docs still have 2 references to unbound methods:

For callables, it may indicate that an instance of the given type (or a 
subclass) is expected or required as the first positional argument (for 
example, CPython sets this attribute for unbound methods that are implemented 
in C).
...
Incorrectly attempting to invoke an unbound method of a class in this way is 
sometimes referred to as ‘metaclass confusion’, and is avoided by bypassing the 
instance when looking up special methods:

So the concept of unbound methods is still valid, and in addition I would 
expect that majority of users think of a method defined in a class as a 
"method" rather than "function defined in class that will become a method" - 
perhaps because the former is much shorter ;-)

Therefore inspect.ismethod() returning False can easily cause confusion.

I think it might be worth adding this note to `ismethod` docs, something like:

"While the term 'unbound method' is commonly used for functions defined on 
class objects, from the point of view of `inspect` it is not a method because 
the object itself is just a plain function."

I can make a PR if this sounds reasonable?

--
nosy: +andrei.avk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5

2021-03-17 Thread Irit Katriel


Irit Katriel  added the comment:

There seems to be agreement on this resolution:

> add a cross link from 'bound method' to
> the 'instance methods' section of the data model docs.

I'm updating version and marking as easy.

--
keywords: +easy
nosy: +iritkatriel
title: inspect.ismethod returns different results on the same basic code 
between Python2.7 Python3.5 -> DOC: inspect.ismethod returns different results 
on the same basic code between Python2.7 Python3.5
type:  -> enhancement
versions: +Python 3.10 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com