This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients GBeauregard, JelleZijlstra, gvanrossum, kj
Date 2022-02-06.23:16:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Looks like the more likely use case would be PEP 563:

from __future__ import annotations
from typing import TypeAlias, get_type_hints

import typing

class C:
    a: TypeAlias = int


This prints

Traceback (most recent call last):
  File "C:\Users\gvanrossum\cpython\", line 9, in <module>
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\", line 1808, in get_type_hints
    value = _eval_type(value, base_globals, base_locals)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\", line 326, in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\", line 690, in _evaluate
    type_ = _type_check(
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\", line 171, in _type_check
    raise TypeError(f"Plain {arg} is not valid as type argument")
Date User Action Args
2022-02-06 23:16:00gvanrossumsetrecipients: + gvanrossum, JelleZijlstra, kj, GBeauregard
2022-02-06 23:16:00gvanrossumsetmessageid: <>
2022-02-06 23:16:00gvanrossumlinkissue46655 messages
2022-02-06 23:16:00gvanrossumcreate