New submission from Steven D'Aprano <st...@pearwood.info>:

The inspect isSOMETHING() functions all return True or False, except 
for isgeneratorfunction(), which returns True or None.

The body of the function is very brief:

if (isfunction(object) or ismethod(object)) and \
        object.func_code.co_flags & CO_GENERATOR:
        return True

The behaviour can be made consistent with the other routines by either 
appending "else: return False", or changing the body to:

return bool(
  (isfunction(object) or ismethod(object)) and
   object.func_code.co_flags & CO_GENERATOR)

----------
components: Library (Lib)
messages: 78661
nosy: stevenjd
severity: normal
status: open
title: inspect.isgeneratorfunction inconsistent with other inspect functions
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4795>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to