mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Add support for PEP 0526.
This makes it possible to assign variables like
asdf: typing.List[int] = []
This commit is contained in:
22
test/completion/pep0526_variables.py
Normal file
22
test/completion/pep0526_variables.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
PEP 526 introduced a new way of using type annotations on variables. It was
|
||||
introduced in Python 3.6.
|
||||
"""
|
||||
# python >= 3.6
|
||||
|
||||
import typing
|
||||
|
||||
asdf = ''
|
||||
asdf: int
|
||||
# This is not necessarily correct, but for now this is ok (at least no error).
|
||||
#? int()
|
||||
asdf
|
||||
|
||||
|
||||
direct: int = NOT_DEFINED
|
||||
#? int()
|
||||
direct
|
||||
|
||||
with_typing_module: typing.List[float] = NOT_DEFINED
|
||||
#? float()
|
||||
with_typing_module[0]
|
||||
Reference in New Issue
Block a user