3.14: add annotationlib, update typing and inspect (#13985)

This commit is contained in:
Jelle Zijlstra authored and GitHub committed 2025-05-10 14:25:06 -07:00
1 parent 8bd5455b32
commit 5ff32f377c
10 files changed
+488 -477

No files matched your search

+11
View File
@@ -367,3 +367,14 @@ else:
from enum import Enum
class StrEnum(str, Enum): ...
# Objects that appear in annotations or in type expressions.
# Similar to PEP 747's TypeForm but a little broader.
AnnotationForm: TypeAlias = Any
if sys.version_info >= (3, 14):
from annotationlib import Format
# These return annotations, which can be arbitrary objects
AnnotateFunc: TypeAlias = Callable[[Format], dict[str, AnnotationForm]]
EvaluateFunc: TypeAlias = Callable[[Format], AnnotationForm]