Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
97adf070
Commit
97adf070
authored
Mar 27, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable set.update() optimization due to Python incompatibility.
set.update() is actually variadic. Fixes #1645.
parent
d1306d23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+3
-2
tests/run/set.pyx
tests/run/set.pyx
+12
-0
No files found.
Cython/Compiler/Builtin.py
View file @
97adf070
...
@@ -319,8 +319,9 @@ builtin_types_table = [
...
@@ -319,8 +319,9 @@ builtin_types_table = [
BuiltinMethod
(
"clear"
,
"T"
,
"r"
,
"PySet_Clear"
),
BuiltinMethod
(
"clear"
,
"T"
,
"r"
,
"PySet_Clear"
),
# discard() and remove() have a special treatment for unhashable values
# discard() and remove() have a special treatment for unhashable values
# BuiltinMethod("discard", "TO", "r", "PySet_Discard"),
# BuiltinMethod("discard", "TO", "r", "PySet_Discard"),
BuiltinMethod
(
"update"
,
"TO"
,
"r"
,
"__Pyx_PySet_Update"
,
# update is actually variadic (see Github issue #1645)
utility_code
=
UtilityCode
.
load_cached
(
"PySet_Update"
,
"Builtins.c"
)),
# BuiltinMethod("update", "TO", "r", "__Pyx_PySet_Update",
# utility_code=UtilityCode.load_cached("PySet_Update", "Builtins.c")),
BuiltinMethod
(
"add"
,
"TO"
,
"r"
,
"PySet_Add"
),
BuiltinMethod
(
"add"
,
"TO"
,
"r"
,
"PySet_Add"
),
BuiltinMethod
(
"pop"
,
"T"
,
"O"
,
"PySet_Pop"
)]),
BuiltinMethod
(
"pop"
,
"T"
,
"O"
,
"PySet_Pop"
)]),
(
"frozenset"
,
"PyFrozenSet_Type"
,
[]),
(
"frozenset"
,
"PyFrozenSet_Type"
,
[]),
...
...
tests/run/set.pyx
View file @
97adf070
...
@@ -88,6 +88,18 @@ def test_set_update(v=None):
...
@@ -88,6 +88,18 @@ def test_set_update(v=None):
return
s1
return
s1
def
test_set_multi_update
(
a
,
b
,
c
):
"""
>>> type(test_set_multi_update()) is set
True
>>> sorted(test_set_multi_update())
"""
[
'a'
,
'b'
,
'c'
,
1
,
2
,
(
1
,
2
)]
cdef
set
s1
=
set
()
s1
.
update
(
'abc'
,
set
([
1
]),
frozenset
((
1
,
2
)))
return
s1
def
test_object_update
(
v
=
None
):
def
test_object_update
(
v
=
None
):
"""
"""
>>> type(test_object_update()) is set
>>> type(test_object_update()) is set
...
...
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