mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Support for typing.Tuple[type, ...]
This commit is contained in:
@@ -35,6 +35,11 @@ def factory(typing_name, indextypes):
|
||||
|
||||
class Tuple(Sequence, tuple):
|
||||
def __getitem__(self, index):
|
||||
if indextypes[1] == ...:
|
||||
# https://www.python.org/dev/peps/pep-0484/#the-typing-module
|
||||
# Tuple[int, ...] means a tuple of ints of indetermined length
|
||||
return indextypes[0]()
|
||||
else:
|
||||
return indextypes[index]()
|
||||
|
||||
class AbstractSet(Iterable, abc.Set):
|
||||
|
||||
@@ -83,7 +83,7 @@ def tuple(
|
||||
q[2]
|
||||
#? B()
|
||||
r[0]
|
||||
##? B() --- TODO fix support for arbitrary length
|
||||
#? B()
|
||||
r[1]
|
||||
#? B()
|
||||
r[2]
|
||||
|
||||
Reference in New Issue
Block a user