-
-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes it possible to assign variables like asdf: typing.List[int] = []
- Loading branch information
1 parent
6d00a57
commit 3f09f3a
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |