Commit 3dc2263e authored by Stefan Behnel's avatar Stefan Behnel

when indexing/slicing 'str', it's safe to infer 'str' for the result

parent 1e12bf46
......@@ -2087,8 +2087,8 @@ class IndexNode(ExprNode):
return base_type.base_type
# may be slicing or indexing, we don't know
if base_type is unicode_type:
# this type always returns its own type on Python indexing/slicing
if base_type in (unicode_type, str_type):
# these types always returns their own type on Python indexing/slicing
return base_type
else:
# TODO: Handle buffers (hopefully without too much redundancy).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment