[issue20489] help() fails for zlib Compress and Decompress objects

Larry Hastings report at bugs.python.org
Mon Feb 3 16:10:12 CET 2014


Larry Hastings added the comment:

Nope, we can't fix it in zlib.  As far as I can tell, the problem is that method_get() in descrobject.c passes in NULL for the module to PyCFunction_NewEx().  method_get gets the type as part of the descriptor protocol, but type objects in C don't appear to have a module pointer.  Module objects in Python do seem to, so maybe we can get it from somewhere?

If we can't fix this, we'll have to go back to expressly writing the name of the module in the expression ("zlib.Z_FINISH").  I assume changing the expression to use Z_FINISH (etc) makes it work again?

I'm calling in Nick, maybe he'll know what to do.

Nick: default values in text signatures allow simple expressions. inspect.Signature looks up the values of constant-ish things like "sys.maxsize".  It allows you to name constants from the local module without the module name first; it gets the module using the __module__ attribute on the callable.

----------
nosy: +ncoghlan

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20489>
_______________________________________


More information about the Python-bugs-list mailing list