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
72ed6884
Commit
72ed6884
authored
Jan 05, 2002
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement PyObject_DelItemString. Fixes #498915.
parent
25c99f03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
Include/abstract.h
Include/abstract.h
+8
-0
Objects/abstract.c
Objects/abstract.c
+18
-0
No files found.
Include/abstract.h
View file @
72ed6884
...
...
@@ -445,6 +445,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
statement: o[key]=v.
*/
DL_IMPORT
(
int
)
PyObject_DelItemString
(
PyObject
*
o
,
char
*
key
);
/*
Remove the mapping for object, key, from the object *o.
Returns -1 on failure. This is equivalent to
the Python statement: del o[key].
*/
DL_IMPORT
(
int
)
PyObject_DelItem
(
PyObject
*
o
,
PyObject
*
key
);
/*
...
...
Objects/abstract.c
View file @
72ed6884
...
...
@@ -174,6 +174,24 @@ PyObject_DelItem(PyObject *o, PyObject *key)
return
-
1
;
}
int
PyObject_DelItemString
(
PyObject
*
o
,
char
*
key
)
{
PyObject
*
okey
;
int
ret
;
if
(
o
==
NULL
||
key
==
NULL
)
{
null_error
();
return
-
1
;
}
okey
=
PyString_FromString
(
key
);
if
(
okey
==
NULL
)
return
-
1
;
ret
=
PyObject_DelItem
(
o
,
okey
);
Py_DECREF
(
okey
);
return
ret
;
}
int
PyObject_AsCharBuffer
(
PyObject
*
obj
,
const
char
**
buffer
,
int
*
buffer_len
)
...
...
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