[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Raymond Hettinger
Raymond Hettinger 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 ___

[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: Fixed in r68112. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue4795] inspect.isgeneratorfunction inconsistent with other inspect functions

2008-12-31 Thread Steven D'Aprano
New submission from Steven D'Aprano : 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_GEN