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
Gwenaël Samain
cython
Commits
48adadf1
Commit
48adadf1
authored
Jan 13, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use inferred NameNode type for builtin types instead of more generic entry type
parent
dab03a3c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-0
tests/run/py_ucs4_type.pyx
tests/run/py_ucs4_type.pyx
+17
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
48adadf1
...
...
@@ -1755,6 +1755,10 @@ class NameNode(AtomicExprNode):
self
.
check_identifier_kind
()
entry
=
self
.
entry
type
=
entry
.
type
if
(
type
.
is_pyobject
and
self
.
inferred_type
and
self
.
inferred_type
.
is_builtin_type
):
# assume that type inference is smarter than the static entry
type
=
self
.
inferred_type
self
.
type
=
type
def
check_identifier_kind
(
self
):
...
...
tests/run/py_ucs4_type.pyx
View file @
48adadf1
...
...
@@ -252,6 +252,23 @@ def iter_and_in():
if
c
in
u'abCDefGh'
:
print
c
#@cython.test_fail_if_path_exists('//ForInStatNode')
def
iter_inferred
():
"""
>>> iter_inferred()
a
b
c
d
e
"""
uchars
=
list
(
u"abcde"
)
uchars
=
u''
.
join
(
uchars
)
for
c
in
uchars
:
print
c
@
cython
.
test_assert_path_exists
(
'//SwitchStatNode'
,
'//ForFromStatNode'
)
@
cython
.
test_fail_if_path_exists
(
'//ForInStatNode'
)
...
...
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