Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pep-0613.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cannot be used as a return annotation because it is not a valid type.

::

MyType: TypeAlias = ClassName
MyType: TypeAlias = "ClassName"
def foo() -> MyType: ...

Explicit aliases remove ambiguity so neither of the above errors will be
Expand Down Expand Up @@ -153,7 +153,7 @@ Explicit syntax:
x: Type[int] = int # typed global expression

x: TypeAlias = int # type alias
x: TypeAlias = MyClass # type alias
x: TypeAlias = "MyClass" # type alias


Note: The examples above illustrate implicit and explicit alias declarations in
Expand Down