Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e990c79f
Commit
e990c79f
authored
Mar 25, 2002
by
Walter Dörwald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing methods iterkeys, itervalues and iteritems to
dict-proxy objects. Add real docstrings to all methods.
parent
3787c9d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
Objects/descrobject.c
Objects/descrobject.c
+26
-6
No files found.
Objects/descrobject.c
View file @
e990c79f
...
...
@@ -643,6 +643,23 @@ proxy_items(proxyobject *pp)
return
PyMapping_Items
(
pp
->
dict
);
}
static
PyObject
*
proxy_iterkeys
(
proxyobject
*
pp
)
{
return
PyObject_CallMethod
(
pp
->
dict
,
"iterkeys"
,
NULL
);
}
static
PyObject
*
proxy_itervalues
(
proxyobject
*
pp
)
{
return
PyObject_CallMethod
(
pp
->
dict
,
"itervalues"
,
NULL
);
}
static
PyObject
*
proxy_iteritems
(
proxyobject
*
pp
)
{
return
PyObject_CallMethod
(
pp
->
dict
,
"iteritems"
,
NULL
);
}
static
PyObject
*
proxy_copy
(
proxyobject
*
pp
)
{
...
...
@@ -650,12 +667,15 @@ proxy_copy(proxyobject *pp)
}
static
PyMethodDef
proxy_methods
[]
=
{
{
"has_key"
,
(
PyCFunction
)
proxy_has_key
,
METH_O
,
"XXX"
},
{
"get"
,
(
PyCFunction
)
proxy_get
,
METH_VARARGS
,
"XXX"
},
{
"keys"
,
(
PyCFunction
)
proxy_keys
,
METH_NOARGS
,
"XXX"
},
{
"values"
,
(
PyCFunction
)
proxy_values
,
METH_NOARGS
,
"XXX"
},
{
"items"
,
(
PyCFunction
)
proxy_items
,
METH_NOARGS
,
"XXX"
},
{
"copy"
,
(
PyCFunction
)
proxy_copy
,
METH_NOARGS
,
"XXX"
},
{
"has_key"
,
(
PyCFunction
)
proxy_has_key
,
METH_O
,
"D.has_key(k) -> 1 if D has a key k, else 0"
},
{
"get"
,
(
PyCFunction
)
proxy_get
,
METH_VARARGS
,
"D.get(k[,d]) -> D[k] if D.has_key(k), else d. d defaults to None."
},
{
"keys"
,
(
PyCFunction
)
proxy_keys
,
METH_NOARGS
,
"D.keys() -> list of D's keys"
},
{
"values"
,
(
PyCFunction
)
proxy_values
,
METH_NOARGS
,
"D.values() -> list of D's values"
},
{
"items"
,
(
PyCFunction
)
proxy_items
,
METH_NOARGS
,
"D.items() -> list of D's (key, value) pairs, as 2-tuples"
},
{
"iterkeys"
,
(
PyCFunction
)
proxy_iterkeys
,
METH_NOARGS
,
"D.iterkeys() -> an iterator over the keys of D"
},
{
"itervalues"
,(
PyCFunction
)
proxy_itervalues
,
METH_NOARGS
,
"D.itervalues() -> an iterator over the values of D"
},
{
"iteritems"
,
(
PyCFunction
)
proxy_iteritems
,
METH_NOARGS
,
"D.iteritems() -> an iterator over the (key, value) items of D"
},
{
"copy"
,
(
PyCFunction
)
proxy_copy
,
METH_NOARGS
,
"D.copy() -> a shallow copy of D"
},
{
0
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment