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
85f97592
Commit
85f97592
authored
Feb 15, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make SortedDictKeysNode look more like other pass-through nodes
parent
06e56e58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-9
No files found.
Cython/Compiler/ExprNodes.py
View file @
85f97592
...
@@ -6226,25 +6226,25 @@ class DictItemNode(ExprNode):
...
@@ -6226,25 +6226,25 @@ class DictItemNode(ExprNode):
class
SortedDictKeysNode
(
ExprNode
):
class
SortedDictKeysNode
(
ExprNode
):
# build sorted list of dict keys, e.g. for dir()
# build sorted list of dict keys, e.g. for dir()
subexprs
=
[
'
base_dict
'
]
subexprs
=
[
'
arg
'
]
is_temp
=
True
is_temp
=
True
def
__init__
(
self
,
base_dict
):
def
__init__
(
self
,
arg
):
ExprNode
.
__init__
(
self
,
base_dict
.
pos
,
base_dict
=
base_dict
)
ExprNode
.
__init__
(
self
,
arg
.
pos
,
arg
=
arg
)
self
.
type
=
Builtin
.
list_type
self
.
type
=
Builtin
.
list_type
def
analyse_types
(
self
,
env
):
def
analyse_types
(
self
,
env
):
base_dict
=
self
.
base_dict
.
analyse_types
(
env
)
arg
=
self
.
arg
.
analyse_types
(
env
)
if
base_dict
.
type
is
Builtin
.
dict_type
:
if
arg
.
type
is
Builtin
.
dict_type
:
base_dict
=
base_dict
.
as_none_safe_node
(
arg
=
arg
.
as_none_safe_node
(
"'NoneType' object is not iterable"
)
"'NoneType' object is not iterable"
)
self
.
base_dict
=
base_dict
self
.
arg
=
arg
return
self
return
self
def
generate_result_code
(
self
,
code
):
def
generate_result_code
(
self
,
code
):
dict_result
=
self
.
base_dict
.
py_result
()
dict_result
=
self
.
arg
.
py_result
()
if
self
.
base_dict
.
type
is
Builtin
.
dict_type
:
if
self
.
arg
.
type
is
Builtin
.
dict_type
:
function
=
'PyDict_Keys'
function
=
'PyDict_Keys'
else
:
else
:
function
=
'PyMapping_Keys'
function
=
'PyMapping_Keys'
...
...
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