summaryrefslogtreecommitdiffstats
path: root/Lib/test/typinganndata
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2024-04-19 13:03:44 (GMT)
committerGitHub <noreply@github.com>2024-04-19 13:03:44 (GMT)
commit1e3e7ce11e3b0fc76e981db85d27019d6d210bbc (patch)
treec9b6e5ad1054a6eef89050027202d71f58497d08 /Lib/test/typinganndata
parent15b3555e4a47ec925c965778a415dc11f0f981fd (diff)
downloadcpython-1e3e7ce11e3b0fc76e981db85d27019d6d210bbc.zip
cpython-1e3e7ce11e3b0fc76e981db85d27019d6d210bbc.tar.gz
cpython-1e3e7ce11e3b0fc76e981db85d27019d6d210bbc.tar.bz2
gh-114053: Fix bad interaction of PEP-695, PEP-563 and ``get_type_hints`` (#118009)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/test/typinganndata')
-rw-r--r--Lib/test/typinganndata/ann_module695.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/test/typinganndata/ann_module695.py b/Lib/test/typinganndata/ann_module695.py
new file mode 100644
index 0000000..2ede9fe
--- /dev/null
+++ b/Lib/test/typinganndata/ann_module695.py
@@ -0,0 +1,22 @@
+from __future__ import annotations
+from typing import Callable
+
+
+class A[T, *Ts, **P]:
+ x: T
+ y: tuple[*Ts]
+ z: Callable[P, str]
+
+
+class B[T, *Ts, **P]:
+ T = int
+ Ts = str
+ P = bytes
+ x: T
+ y: Ts
+ z: P
+
+
+def generic_function[T, *Ts, **P](
+ x: T, *y: *Ts, z: P.args, zz: P.kwargs
+) -> None: ...