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

2014-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ ___

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

2014-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 31ddd45a05ba by Serhiy Storchaka in branch 'default': Issue #20489: Explicitly qualified expressions for default values in methods. http://hg.python.org/cpython/rev/31ddd45a05ba -- nosy: +python-dev ___ P

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

2014-02-04 Thread Nick Coghlan
Nick Coghlan added the comment: If qualifying the expression explicitly does the trick, that sounds good, too :) -- ___ Python tracker ___ ___

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

2014-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Expressly writing the name of the module in the expression solves this issue. -- stage: -> patch review Added file: http://bugs.python.org/file33901/zlib_parameters_defaults.patch ___ Python tracker

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

2014-02-04 Thread Nick Coghlan
Nick Coghlan added the comment: For example, see the builtins patch on issue 20184 where I initially converted sorted() to AC, but then found that making it *work* as an AC function was actually quite difficult due to the PyList implementation expecting to be given a arg tuple and kwds dict.

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

2014-02-04 Thread Nick Coghlan
Nick Coghlan added the comment: For 3.4, I'd prefer to just not convert these functions. The right fix is to figure out how to get __name__ set appropriately, and that's something the C extension module improvements in 3.5 should be able to help with. -- __

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

2014-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: Attached is an experimental patch (issue20489_01.patch) that implements the idea of encoding full function name in its 'sig=' spec. Test file: import zlib import inspect print(zlib.compressobj().flush.__text_signature__) print(inspect.signature(zl

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

2014-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: > One way, albeit ugly, would be to further extend > __text_signature__ format, to allow something like: > > sig=(...);module=zlib OR sig=zlib.Compress.flush(...) -- ___ Python tracker

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

2014-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: One way, albeit ugly, would be to further extend __text_signature__ format, to allow something like: sig=(...);module=zlib -- ___ Python tracker __

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

2014-02-03 Thread Larry Hastings
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 ha

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

2014-02-03 Thread Yury Selivanov
Yury Selivanov added the comment: The problem is that 'zlib.compressobj().flush.__module__ is None' Can we fix that in zlib? -- ___ Python tracker ___ ___

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

2014-02-02 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: >>> import zlib >>> d = zlib.decompressobj() >>> d >>> c = zlib.compressobj() >>> c >>> zlib.DEF_BUF_SIZE 16384 >>> zlib.Z_FINISH 4 >>> help(c) Traceback (most recent call last): File "/home/serhiy/py/cpython/Lib/inspect.py", line 2243, in wrap_value