Author martin.panter
Recipients docs@python, martin.panter, serhiy.storchaka
Date 2015-03-22.10:31:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427020261.31.0.215855760889.issue23738@psf.upfronthosting.co.za>
In-reply-to
Content
This patch adds the PEP 457 positional-only slash “/” indicator to some function signatures in the documentation. I only looked at the the os, builtin, binascii, zlib and fcntl modules, and their functions where the documentation incorrectly suggests that they accept keyword arguments. For example, I changed

eval(expression, globals=None, locals=None)

to

eval(expression, globals=None, locals=None, /)

References:

* Issue 22832: “fcntl” module changed to look like accepting keyword arguments
* Ongoing discussion: <https://mail.python.org/pipermail/python-dev/2015-March/138847.html>

There are many more instances where square brackets are used, or the arguments are mandatory. See the PEP for examples, but I do not think it is so important to “fix” them.

I also fixed parameter name mismatches that I discovered for a quite a few functions that do take keyword arguments.

One more thing I noticed, that I do not know how to fix, is the Argument Clinic signatures list invalid default values for zlib.compressobj(zdict=None) and os.utime(ns=None):

>>> zlib.compressobj(zdict=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' does not support the buffer interface
>>> os.utime("dummy", ns=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: utime: 'ns' must be a tuple of two ints
History
Date User Action Args
2015-03-22 10:31:02martin.pantersetrecipients: + martin.panter, docs@python, serhiy.storchaka
2015-03-22 10:31:01martin.pantersetmessageid: <1427020261.31.0.215855760889.issue23738@psf.upfronthosting.co.za>
2015-03-22 10:31:01martin.panterlinkissue23738 messages
2015-03-22 10:31:01martin.pantercreate