Raymond Hettinger <[email protected]> added the comment:
This can be simplified to just:
return (isfunction(object) or ismethod(object)) and \
object.func_code.co_flags & CO_GENERATOR
No need for patterns like:
if cond:
return True
return False
----------
nosy: +rhettinger
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue4795>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com