[New-bugs-announce] [issue16395] Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.

Simon Law report at bugs.python.org
Sat Nov 3 16:18:21 CET 2012


New submission from Simon Law:

The documentation in Python 2.7, 3.2, and 3.3 claim that:

PyObject* PySequence_Fast(PyObject *o, const char *m)
Return value: New reference.
Returns the sequence o as a tuple, unless it is already a tuple or list, in which case o is returned...

Unfortunately, the code does this in Objects/abstract.c:

    v = PySequence_List(it);

And the header file in Include/abstract.h matches the documentation:

     PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
       /*
     Returns the sequence, o, as a tuple, unless it's already a
     tuple or list.
       */

----------
components: Interpreter Core
messages: 174633
nosy: sfllaw
priority: normal
severity: normal
status: open
title: Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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


More information about the New-bugs-announce mailing list