Why is there no instancemethod builtin?

Michele Simionato michele.simionato at gmail.com
Sun Jun 19 12:05:46 EDT 2005


In this case I have used hasattr(obj, "__iter__") instead of
isinstance(obj, list)
(strings are iterable but do not have __iter__ method). I think hasattr
is much better
since it works for tuples and custom iterables too.

          Michele Simionato




More information about the Python-list mailing list