summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
commitcc2b0161257495f859200bce0aea3ed7e646feb3 (patch)
treeba09aba0de6447bef5be59b43fb86d17d760833d /Include
parent4e66dfcdc495218ad5f98b12ad6b4b2b05630ab0 (diff)
downloadcpython-cc2b0161257495f859200bce0aea3ed7e646feb3.zip
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.gz
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.bz2
- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views. The dict views aren't fully functional yet; in particular, they can't be compared to sets yet. but they are useful as "iterator wells". There are still 27 failing unit tests; I expect that many of these have fairly trivial fixes, but there are so many, I could use help.
Diffstat (limited to 'Include')
-rw-r--r--Include/abstract.h35
1 files changed, 13 insertions, 22 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index 1eab5f8..661c288 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -1127,37 +1127,28 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
- /* Implemented as macro:
+ PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o);
- PyObject *PyMapping_Keys(PyObject *o);
-
- On success, return a list of the keys in object o. On
- failure, return NULL. This is equivalent to the Python
- expression: o.keys().
+ /*
+ On success, return a list or tuple of the keys in object o.
+ On failure, return NULL.
*/
-#define PyMapping_Keys(O) PyObject_CallMethod(O,"keys",NULL)
-
- /* Implemented as macro:
- PyObject *PyMapping_Values(PyObject *o);
+ PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o);
- On success, return a list of the values in object o. On
- failure, return NULL. This is equivalent to the Python
- expression: o.values().
+ /*
+ On success, return a list or tuple of the values in object o.
+ On failure, return NULL.
*/
-#define PyMapping_Values(O) PyObject_CallMethod(O,"values",NULL)
-
- /* Implemented as macro:
- PyObject *PyMapping_Items(PyObject *o);
+ PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o);
- 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: o.items().
+ /*
+ 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.
*/
-#define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, char *key);