classification
Title: documentation of PyUnicode_Format() states wrong argument type requirements
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: BreamoreBoy, docs@python, python-dev, scoder
Priority: normal Keywords:

Created on 2013-02-15 13:20 by scoder, last changed 2014-07-19 23:35 by python-dev. This issue is now closed.

Messages (3)
msg182140 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2013-02-15 13:20
The current documentation says:

"""
PyObject* PyUnicode_Format(PyObject *format, PyObject *args)
    Return value: New reference.

    Return a new string object from format and args; this is analogous to format % args. The args argument must be a tuple.
"""

According to the implementation, however, "args" can be a tuple, a unicode string, or an arbitrary mapping, i.e. everything that Python's "%" operator allows for strings as well.
msg223381 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-17 22:22
@Stefan could you provide a patch for this?
msg223488 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-07-19 23:35
New changeset 9cd3ab7c09d1 by Benjamin Peterson in branch '2.7':
args doesn't need to be a tuple (closes #17210)
http://hg.python.org/cpython/rev/9cd3ab7c09d1

New changeset ffbbd43d7342 by Benjamin Peterson in branch '3.4':
args doesn't need to be a tuple (closes #17210)
http://hg.python.org/cpython/rev/ffbbd43d7342

New changeset 2fc379ce5762 by Benjamin Peterson in branch 'default':
merge 3.4 (#17210)
http://hg.python.org/cpython/rev/2fc379ce5762
History
Date User Action Args
2014-07-19 23:35:32python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg223488

resolution: fixed
stage: resolved
2014-07-17 22:22:03BreamoreBoysetnosy: + BreamoreBoy

messages: + msg223381
versions: + Python 3.5, - Python 2.6, Python 3.2, Python 3.3
2013-02-15 13:20:26scodercreate