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): ...@@ -2087,8 +2087,8 @@ class IndexNode(ExprNode):
return base_type.base_type return base_type.base_type
# may be slicing or indexing, we don't know # may be slicing or indexing, we don't know
if base_type is unicode_type: if base_type in (unicode_type, str_type):
# this type always returns its own type on Python indexing/slicing # these types always returns their own type on Python indexing/slicing
return base_type return base_type
else: else:
# TODO: Handle buffers (hopefully without too much redundancy). # 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