Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 17, 2009, 12:56 PM

Post #1 of 2 (115 views)
Permalink
[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

Jean-Paul Calderone <exarkun [at] divmod> added the comment:

How about bringing callable back since there is no obvious replacement
for it? It's valuable as a LYBL check in circumstances where an object
submitted far away from the place where it's invoked. Such uses can't
easily be replaced with direct calls to follow the recommended EAFP style.

----------
nosy: +exarkun

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7006>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 17, 2009, 1:16 PM

Post #2 of 2 (103 views)
Permalink
[issue7006] The replacement suggested for callable(x) in py3k is not equivalent [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

I also think isinstance(x, collections.Callable) is the correct
replacement. Even though it might give a different answer on weird
corner cases, it is semantically what you are looking for.
(too bad it has a stupid module placement)

----------
nosy: +pitrou

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7006>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.