[issue20193] Derby: Convert the zlib, _bz2 and _lzma modules to use Argument Clinic

Larry Hastings report at bugs.python.org
Thu Jan 9 00:56:05 CET 2014


Larry Hastings added the comment:

> * I have experimented in zlib_decompressobj, and I got good compact
>   code, but wrong docstring ("decompressobj(wbits=None, zdict=None)").
>  Needed a way to specify optional parameters without default Python
>  values. Correct signature should be something like
>  "decompressobj([wbits], [zdict])".

"decompressobj([wbits], [zdict])" isn't valid Python.  "decompressobj(wbits=None, zdict=None)" is; both wbits and zdict are positional-or-keyword parameters with defaults.  If you were writing decompressobj() in Python, and you wanted to simulate its argument parsing as closely as possible, you'd write what Argument Clinic generated.

You shouldn't use a default of "None" for wbits, though (and Argument Clinic shouldn't have let you).  How about_zlib.MAX_WBITS ?

----------

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


More information about the Python-bugs-list mailing list