This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients docs@python, serhiy.storchaka
Date 2015-12-19.11:38:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450525085.87.0.352365699992.issue25909@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation and comments for PyMapping_Items, PyMapping_Keys and PyMapping_Values are not correct about return type.

The documentation says that return type is a list. For example for PyMapping_Items:

   On success, return a list of the items in object *o*, where each item is a tuple
   containing a key-value pair.  On failure, return *NULL*. This is equivalent to
   the Python expression ``list(o.items())``.

The comment in Include/abstract.h is more correct, it mentions tuple:

     On success, return a list or tuple of the items in object o,
     where each item is a tuple containing a key-value pair.
     On failure, return NULL.

Actually PyMapping_Items in 3.x can return a list, a tuple, or a dict view (for dict).

The same for PyMapping_Keys and PyMapping_Values.
History
Date User Action Args
2015-12-19 11:38:05serhiy.storchakasetrecipients: + serhiy.storchaka, docs@python
2015-12-19 11:38:05serhiy.storchakasetmessageid: <1450525085.87.0.352365699992.issue25909@psf.upfronthosting.co.za>
2015-12-19 11:38:05serhiy.storchakalinkissue25909 messages
2015-12-19 11:38:04serhiy.storchakacreate