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
21191f4f
Commit
21191f4f
authored
Feb 01, 2007
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1648179: set.update() not recognizing __iter__ overrides in dict subclasses.
parent
cd7a78e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
Misc/NEWS
Misc/NEWS
+3
-0
Objects/setobject.c
Objects/setobject.c
+4
-4
No files found.
Misc/NEWS
View file @
21191f4f
...
...
@@ -16,6 +16,9 @@ Core and builtins
a weakref on itself during a __del__ call for new-style classes (classic
classes still have the bug).
- Bug #1648179: set.update() did not recognize an overridden __iter__
method in subclasses of dict.
- Bug #1579370: Make PyTraceBack_Here use the current thread, not the
frame'
s
thread
state
.
...
...
Objects/setobject.c
View file @
21191f4f
...
...
@@ -915,7 +915,7 @@ set_update_internal(PySetObject *so, PyObject *other)
if
(
PyAnySet_Check
(
other
))
return
set_merge
(
so
,
other
);
if
(
PyDict_Check
(
other
))
{
if
(
PyDict_Check
Exact
(
other
))
{
PyObject
*
value
;
Py_ssize_t
pos
=
0
;
while
(
PyDict_Next
(
other
,
&
pos
,
&
key
,
&
value
))
{
...
...
@@ -1363,7 +1363,7 @@ set_difference(PySetObject *so, PyObject *other)
setentry
*
entry
;
Py_ssize_t
pos
=
0
;
if
(
!
PyAnySet_Check
(
other
)
&&
!
PyDict_Check
(
other
))
{
if
(
!
PyAnySet_Check
(
other
)
&&
!
PyDict_Check
Exact
(
other
))
{
result
=
set_copy
(
so
);
if
(
result
==
NULL
)
return
NULL
;
...
...
@@ -1377,7 +1377,7 @@ set_difference(PySetObject *so, PyObject *other)
if
(
result
==
NULL
)
return
NULL
;
if
(
PyDict_Check
(
other
))
{
if
(
PyDict_Check
Exact
(
other
))
{
while
(
set_next
(
so
,
&
pos
,
&
entry
))
{
setentry
entrycopy
;
entrycopy
.
hash
=
entry
->
hash
;
...
...
@@ -1450,7 +1450,7 @@ set_symmetric_difference_update(PySetObject *so, PyObject *other)
if
((
PyObject
*
)
so
==
other
)
return
set_clear
(
so
);
if
(
PyDict_Check
(
other
))
{
if
(
PyDict_Check
Exact
(
other
))
{
PyObject
*
value
;
int
rv
;
while
(
PyDict_Next
(
other
,
&
pos
,
&
key
,
&
value
))
{
...
...
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