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
cfc2a1fc
Commit
cfc2a1fc
authored
Mar 03, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.4 (closes #26478)
parents
ff47cfbc
f11b25b0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
Lib/test/test_dictviews.py
Lib/test/test_dictviews.py
+4
-0
Misc/NEWS
Misc/NEWS
+3
-0
Objects/dictobject.c
Objects/dictobject.c
+4
-5
No files found.
Lib/test/test_dictviews.py
View file @
cfc2a1fc
...
...
@@ -96,6 +96,7 @@ class DictSetTest(unittest.TestCase):
self
.
assertEqual
(
d1
.
keys
()
&
set
(
d1
.
keys
()),
{
'a'
,
'b'
})
self
.
assertEqual
(
d1
.
keys
()
&
set
(
d2
.
keys
()),
{
'b'
})
self
.
assertEqual
(
d1
.
keys
()
&
set
(
d3
.
keys
()),
set
())
self
.
assertEqual
(
d1
.
keys
()
&
tuple
(
d1
.
keys
()),
{
'a'
,
'b'
})
self
.
assertEqual
(
d1
.
keys
()
|
d1
.
keys
(),
{
'a'
,
'b'
})
self
.
assertEqual
(
d1
.
keys
()
|
d2
.
keys
(),
{
'a'
,
'b'
,
'c'
})
...
...
@@ -104,6 +105,7 @@ class DictSetTest(unittest.TestCase):
self
.
assertEqual
(
d1
.
keys
()
|
set
(
d2
.
keys
()),
{
'a'
,
'b'
,
'c'
})
self
.
assertEqual
(
d1
.
keys
()
|
set
(
d3
.
keys
()),
{
'a'
,
'b'
,
'd'
,
'e'
})
self
.
assertEqual
(
d1
.
keys
()
|
(
1
,
2
),
{
'a'
,
'b'
,
1
,
2
})
self
.
assertEqual
(
d1
.
keys
()
^
d1
.
keys
(),
set
())
self
.
assertEqual
(
d1
.
keys
()
^
d2
.
keys
(),
{
'a'
,
'c'
})
...
...
@@ -112,6 +114,7 @@ class DictSetTest(unittest.TestCase):
self
.
assertEqual
(
d1
.
keys
()
^
set
(
d2
.
keys
()),
{
'a'
,
'c'
})
self
.
assertEqual
(
d1
.
keys
()
^
set
(
d3
.
keys
()),
{
'a'
,
'b'
,
'd'
,
'e'
})
self
.
assertEqual
(
d1
.
keys
()
^
tuple
(
d2
.
keys
()),
{
'a'
,
'c'
})
self
.
assertEqual
(
d1
.
keys
()
-
d1
.
keys
(),
set
())
self
.
assertEqual
(
d1
.
keys
()
-
d2
.
keys
(),
{
'a'
})
...
...
@@ -119,6 +122,7 @@ class DictSetTest(unittest.TestCase):
self
.
assertEqual
(
d1
.
keys
()
-
set
(
d1
.
keys
()),
set
())
self
.
assertEqual
(
d1
.
keys
()
-
set
(
d2
.
keys
()),
{
'a'
})
self
.
assertEqual
(
d1
.
keys
()
-
set
(
d3
.
keys
()),
{
'a'
,
'b'
})
self
.
assertEqual
(
d1
.
keys
()
-
(
0
,
1
),
{
'a'
,
'b'
})
self
.
assertFalse
(
d1
.
keys
().
isdisjoint
(
d1
.
keys
()))
self
.
assertFalse
(
d1
.
keys
().
isdisjoint
(
d2
.
keys
()))
...
...
Misc/NEWS
View file @
cfc2a1fc
...
...
@@ -76,6 +76,9 @@ Core and Builtins
__bytes__, __trunc__, and __float__ returning instances of subclasses of
bytes, int, and float to subclasses of bytes, int, and float correspondingly.
- Issue #26478: Fix semantic bugs when using binary operators with dictionary
views and tuples.
- Issue #26171: Fix possible integer overflow and heap corruption in
zipimporter.get_data().
...
...
Objects/dictobject.c
View file @
cfc2a1fc
...
...
@@ -3448,7 +3448,7 @@ dictviews_sub(PyObject* self, PyObject *other)
if
(
result
==
NULL
)
return
NULL
;
tmp
=
_PyObject_CallMethodId
(
result
,
&
PyId_difference_update
,
"O"
,
other
);
tmp
=
_PyObject_CallMethodId
ObjArgs
(
result
,
&
PyId_difference_update
,
other
,
NULL
);
if
(
tmp
==
NULL
)
{
Py_DECREF
(
result
);
return
NULL
;
...
...
@@ -3468,7 +3468,7 @@ _PyDictView_Intersect(PyObject* self, PyObject *other)
if
(
result
==
NULL
)
return
NULL
;
tmp
=
_PyObject_CallMethodId
(
result
,
&
PyId_intersection_update
,
"O"
,
other
);
tmp
=
_PyObject_CallMethodId
ObjArgs
(
result
,
&
PyId_intersection_update
,
other
,
NULL
);
if
(
tmp
==
NULL
)
{
Py_DECREF
(
result
);
return
NULL
;
...
...
@@ -3488,7 +3488,7 @@ dictviews_or(PyObject* self, PyObject *other)
if
(
result
==
NULL
)
return
NULL
;
tmp
=
_PyObject_CallMethodId
(
result
,
&
PyId_update
,
"O"
,
other
);
tmp
=
_PyObject_CallMethodId
ObjArgs
(
result
,
&
PyId_update
,
other
,
NULL
);
if
(
tmp
==
NULL
)
{
Py_DECREF
(
result
);
return
NULL
;
...
...
@@ -3508,8 +3508,7 @@ dictviews_xor(PyObject* self, PyObject *other)
if
(
result
==
NULL
)
return
NULL
;
tmp
=
_PyObject_CallMethodId
(
result
,
&
PyId_symmetric_difference_update
,
"O"
,
other
);
tmp
=
_PyObject_CallMethodIdObjArgs
(
result
,
&
PyId_symmetric_difference_update
,
other
,
NULL
);
if
(
tmp
==
NULL
)
{
Py_DECREF
(
result
);
return
NULL
;
...
...
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