made typing classes inheritable; added MutableSequence and List

This commit is contained in:
Claude committed 2016-01-17 10:41:40 +01:00
1 parent f5a31ad78e
commit 52cc721f45
5 files changed
+70 -41

No files matched your search

+8 -4
View File
@@ -572,11 +572,15 @@ def py__getitem__(evaluator, types, index, node):
# https://github.com/davidhalter/jedi/issues/663
for typ in list(types):
if isinstance(typ, Class):
replacementclass = \
pep0484.get_typing_replacement_class(evaluator, typ)
if replacementclass:
typing_module_types = \
pep0484.get_types_for_typing_module(evaluator, typ, index)
if typing_module_types is not None:
types.remove(typ)
result |= replacementclass.py__getitem__(index)
result |= typing_module_types
if not types:
# all consumed by special cases
return result
if type(index) not in (float, int, str, unicode, slice):
# If the index is not clearly defined, we have to get all the