[issue16851] Hint about correct ismethod and isfunction usage

2016-06-04 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue16851] Hint about correct ismethod and isfunction usage

2016-06-04 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Sounds like this can be closed?

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue16851] Hint about correct ismethod and isfunction usage

2016-03-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a90b39aa6af4 by Victor Stinner in branch '2.7':
Issue #16851: Add Anna Koroliuk to Misc/ACKS
https://hg.python.org/cpython/rev/a90b39aa6af4

--

___
Python tracker 

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



[issue16851] Hint about correct ismethod and isfunction usage

2016-03-11 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Anna, I pushed your doc fix.

Can you please sign the Python Contributor Agreement?
https://www.python.org/psf/contrib/

--
nosy: +haypo
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open

___
Python tracker 

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



[issue16851] Hint about correct ismethod and isfunction usage

2016-03-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 813a0e0934ce by Victor Stinner in branch '2.7':
Fix inspect.ismethod() doc
https://hg.python.org/cpython/rev/813a0e0934ce

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue16851] Hint about correct ismethod and isfunction usage

2016-03-11 Thread Anna Koroliuk

Anna Koroliuk added the comment:

This patch fixes Python 2.7.

--
nosy: +Anna Koroliuk
Added file: http://bugs.python.org/file42128/inspect2.patch

___
Python tracker 

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



[issue16851] Hint about correct ismethod and isfunction usage

2013-03-04 Thread Thomas Kluyver

Thomas Kluyver added the comment:

I agree that the docs for inspect.ismethod() for Python 2 are wrong.

The docs say: Return true if the object is a bound method written in Python.

However, it also returns True for an unbound method:

 class A:
... def meth(self):
... pass
... 
 A.meth
unbound method A.meth
 import inspect
 inspect.ismethod(A.meth)
True

--
nosy: +takluyver

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16851] Hint about correct ismethod and isfunction usage

2013-03-04 Thread Ezio Melotti

Ezio Melotti added the comment:

I checked the tests on 2.7 and found this:

# contrary to spec, ismethod() is also True for unbound methods
# (see #1785)
self.assertIn(('f', B.f), inspect.getmembers(B, inspect.ismethod))

#1785 also has some discussion about this.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16851] Hint about correct ismethod and isfunction usage

2013-02-11 Thread Greg Couch

Greg Couch added the comment:

In my opinion, the Python 2.7 results are wrong.

In Python 2.7, inspect.ismethod returns True for both bound and unbound methods 
-- ie., is broken according to the documentation.  As a workaround, I'm using:

def is_bound_method(obj):
return hasattr(obj, '__self__') and obj.__self__ is not None

is_bound_method also works for methods of classes implemented in C, e.g., int:

 a = 1
 is_bound_method(a.__add__)
True
 is_bound_method(int.__add__)
False

But is not very useful in that case because inspect.getargspec does not work 
for functions implemented in C.

is_bound_method works unchanged in Python 3, but as noted above, in Python 3, 
inspect.ismethod properly distinguishes between bound and unbound methods, so 
it is not necessary.

--
nosy: +gregcouch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16851] Hint about correct ismethod and isfunction usage

2013-01-10 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +chris.jerdonek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16851] Hint about correct ismethod and isfunction usage

2013-01-08 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
title: ismethod and isfunction methods error - Hint about correct ismethod and 
isfunction usage

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16851] Hint about correct ismethod and isfunction usage

2013-01-08 Thread Federico Reghenzani

Changes by Federico Reghenzani federico@reghe.net:


--
nosy: +federico.reghenzani

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16851] Hint about correct ismethod and isfunction usage

2013-01-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee: docs@python - ezio.melotti
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16851
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com