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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
708875fa
Commit
708875fa
authored
May 31, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep subtype definition order of fused types also for fused subtypes
avoid antipattern of sum()-ing lists
parent
152e9d58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+10
-6
No files found.
Cython/Compiler/PyrexTypes.py
View file @
708875fa
...
...
@@ -1339,12 +1339,16 @@ class FusedType(CType):
exception_check
=
0
def
__init__
(
self
,
types
,
name
=
None
):
# Use list rather than set to preserve order.
flattened_types
=
[
t
for
t
in
types
if
not
t
.
is_fused
]
subtypes
=
sum
([
t
.
types
for
t
in
types
if
t
.
is_fused
],
[])
for
type
in
subtypes
:
if
type
not
in
flattened_types
:
flattened_types
.
append
(
type
)
# Use list rather than set to preserve order (list should be short).
flattened_types
=
[]
for
t
in
types
:
if
t
.
is_fused
:
# recursively merge in subtypes
for
subtype
in
t
.
types
:
if
subtype
not
in
flattened_types
:
flattened_types
.
append
(
subtype
)
elif
t
not
in
flattened_types
:
flattened_types
.
append
(
t
)
self
.
types
=
flattened_types
self
.
name
=
name
...
...
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