mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-03 17:12:42 +08:00
Merge pull request #1572 from davidhalter/classvar
Remove is_class_value from infer_type_vars
This commit is contained in:
@@ -10,6 +10,7 @@ from typing import (
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
Sequence,
|
||||
)
|
||||
|
||||
K = TypeVar('K')
|
||||
@@ -165,6 +166,9 @@ some_str = NotImplemented # type: str
|
||||
#? str()
|
||||
first(some_str)
|
||||
|
||||
annotated = [len] # type: List[ Callable[[Sequence[float]], int] ]
|
||||
#? int()
|
||||
first(annotated)()
|
||||
|
||||
# Test that the right type is chosen when a partially realised mapping is expected
|
||||
def values(mapping: Mapping[int, T]) -> List[T]:
|
||||
|
||||
@@ -656,7 +656,8 @@ def bar():
|
||||
({'return': 'typing.Optional[str, int]'}, [], ''), # Takes only one arg
|
||||
({'return': 'typing.Any'}, [], ''),
|
||||
|
||||
({'return': 'typing.Tuple[int, str]'}, ['tuple'], ''),
|
||||
({'return': 'typing.Tuple[int, str]'},
|
||||
['Tuple' if sys.version_info[:2] == (3, 6) else 'tuple'], ''),
|
||||
({'return': 'typing.Tuple[int, str]'}, ['int'], 'x()[0]'),
|
||||
({'return': 'typing.Tuple[int, str]'}, ['str'], 'x()[1]'),
|
||||
({'return': 'typing.Tuple[int, str]'}, [], 'x()[2]'),
|
||||
|
||||
Reference in New Issue
Block a user