projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e12bf4
)
when indexing/slicing 'str', it's safe to infer 'str' for the result
author
Stefan Behnel
<scoder@users.berlios.de>
Sun, 6 Feb 2011 15:14:48 +0000
(16:14 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sun, 6 Feb 2011 15:14:48 +0000
(16:14 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index 07b0db220fadc1672e25c3390f8300e32e8c690a..86a26c7cc074f1ca4004f99f0d82f57e5806a4f8 100755
(executable)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-2087,8
+2087,8
@@
class IndexNode(ExprNode):
return base_type.base_type
# may be slicing or indexing, we don't know
- if base_type i
s unicode_type
:
- # th
is type always returns its
own type on Python indexing/slicing
+ if base_type i
n (unicode_type, str_type)
:
+ # th
ese types always returns their
own type on Python indexing/slicing
return base_type
else:
# TODO: Handle buffers (hopefully without too much redundancy).