Raymond Hettinger <[email protected]> added the comment:
Instead of
hasattr(str,'next')
consider using
isinstance(str, collections.Iterable)
Also consider changing the variable name from the now overly type specific,
"str" to something like "source" to indicate the significance of the data, not
its type.
----------
nosy: +rhettinger
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue3243>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com