1
0
forked from VimPlug/jedi

made typing classes inheritable; added MutableSequence and List

This commit is contained in:
Claude
2015-12-30 16:39:17 +01:00
parent f5a31ad78e
commit 52cc721f45
5 changed files with 70 additions and 41 deletions
+25
View File
@@ -0,0 +1,25 @@
"""
This module is not intended to be used in jedi, rather it will be fed to the
jedi-parser to replace classes in the typing module
"""
from collections import abc
def factory(typing_name, indextype):
class Sequence(abc.Sequence):
def __getitem__(self) -> indextype:
pass
class MutableSequence(Sequence, abc.MutableSequence):
pass
class List(MutableSequence, list):
pass
dct = {
"Sequence": Sequence,
"MutableSequence": MutableSequence,
"List": List,
}
return dct[typing_name]