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

2014-02-05 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20489

[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-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 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-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 rep...@bugs.python.org http://bugs.python.org/issue20489 ___

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue20489

[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 rep...@bugs.python.org

[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__)

[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 zlib.Decompress object at 0xb70a9288 c = zlib.compressobj() c zlib.Compress object at 0xb6f85ac8 zlib.DEF_BUF_SIZE 16384 zlib.Z_FINISH 4 help(c) Traceback (most recent call last): File