<br><div class="gmail_quote">On Fri, Sep 25, 2009 at 4:34 PM, Andrey Fedorov <span dir="ltr"><<a href="mailto:anfedorov@gmail.com">anfedorov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

So there was a discussion back in April [0] about the lack of an "iterable" predicate, which Pascal pointing out that the intention may be to use "isinstance(obj, Iterable)" instead. That seems inconsistent with the existence of collections.Callable (so, isinstance(obj, Callable) instead of callable(obj)).<br>



<br>Which direction is this more likely to be resolved? Should I write iterable(obj) or expect callable(obj) to be deprecated? <br></blockquote><div><br>The latter : callable() has been removed in Python 3 and the new way is to check the existence of the __call__() method => hasattr(obj, '__call__')<br>

 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>- Andrey<br><br>0. <a href="http://mail.python.org/pipermail/python-ideas/2009-April/004382.html" target="_blank">http://mail.python.org/pipermail/python-ideas/2009-April/004382.html</a><br>



<br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br></blockquote></div><br><br>Cheers,<br>Quentin<br>