| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
(#112633)
[3.12] gh-112618: Make Annotated cache typed (GH-112619) (GH-112628)
(cherry picked from commit 2a378ca2efcb91db4b04fb4e052424fd610ffbc9)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
|
|
|
|
| |
optional_keys in TypedDict (GH-112512) (#112531)
(cherry picked from commit 403886942376210662610627b01fea6acd77d331)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
| |
|
|
|
|
| |
(GH-111825) (#111860)
|
|
|
|
|
|
|
|
| |
`test_typing` (GH-111127) (#111131)
gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (GH-111127)
(cherry picked from commit ea7c26e4b89c71234c4a603567a93f0a44c9cc97)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
|
|
|
|
|
|
| |
(#108354) (#109673)
gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354)
(cherry picked from commit 3f61cf646d0506baa0c0c2118f05110446519c62)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
|
| |
protocols decorated with `@final` (#105445)
|
|
|
|
|
|
| |
Remove raw asserts in test_typing.py (GH-104951)
(cherry picked from commit 2cb445635e99d4401949cabebd373288cfdd0138)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
| |
In particular, it's important to test that is_typeddict(TypedDict)
returns False.
(cherry picked from commit 1497607a8e99f1103c40368dd5f9057f0146a520)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
| |
During the PEP 695 implementation at one point I made
TypeVar.__name__ return garbage, and all of test_typing passed.
So I decided to add a few more tests.
(cherry picked from commit 26931944dd8abd6554249239344fa62b789b9028)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
| |
gh-104036: Fix direct invocation of test_typing (GH-104037)
Previously, `python -m test test_typing` worked, but `python Lib/test/test_typing.py` did not.
(cherry picked from commit 4181d078fc945313568eb39965cb9190881606b5)
Co-authored-by: Kirill Podoprigora <80244920+Eclips4@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
(GH-103747) (#103772)
gh-103746: Test `types.UnionType` and `Literal` types together (GH-103747)
(cherry picked from commit 3d29edaf0a5f2e12e7f72552f602c761ddaf0d13)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
| |
`Literal`s (GH-103706) (#103720)
gh-103592: Add tests of `Literal` with `Enum` and `Union` of `Literal`s (GH-103706)
(cherry picked from commit 5041c2ba6e9c992d1c54834481c9be64581c0235)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit a28e2ce3fbcc852959324879e0bbf5ba8ecf0105)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit 800382a2b0980c21dfb2a8ac02aaf1e881f987b9)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
|
|
|
| |
(cherry picked from commit 60bdc16b459cf8f7b359c7f87d8ae6c5928147a4)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`ParamSpec` substitution (GH-102808)
Previously, this used to fail:
```py
from typing import *
T = TypeVar("T")
P = ParamSpec("P")
class X(Generic[P]):
f: Callable[P, int]
Y = X[[int, T]]
Z = Y[str]
```
(cherry picked from commit adb0621652f489033b9db8d3949564c9fe545c1d)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
|
|
|
| |
`_collections_abc._CallableGenericAlias` (GH-102788)
This is a backport of https://github.com/python/cpython/pull/102722 without the `typing.py` changes.
Automerge-Triggered-By: GH:AlexWaygood
|
|
|
|
|
|
|
|
| |
`isinstance()` checks on `typing.runtime_checkable` protocols (GH-102449)
(cherry picked from commit 5ffdaf748d98da6065158534720f1996a45a0072)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
|
|
|
|
|
| |
(cherry picked from commit 96e10229292145012bc462a6ab3ce1626c8acf71)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
|
|
|
| |
As part of investigation issue https://github.com/python/cpython/issues/102433, I discovered what I believe to be an error where two classes `CI` and `DI` are not being used. The assertions beneath them act on `C` and `D`, duplicating existing assertions in this test.
(cherry picked from commit 7894bbe94ba319eb650f383cb5196424c77b2cfd)
Co-authored-by: JosephSBoyle <48555120+JosephSBoyle@users.noreply.github.com>
Automerge-Triggered-By: GH:AlexWaygood
|
|
|
|
|
|
|
| |
parent fields (GH-101563)
(cherry picked from commit b96b344f251954bb64aeb13c3e0c460350565c2a)
Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
|
|
|
|
|
|
|
| |
(GH-101031)
(cherry picked from commit 807d6b576fa37f3ab7eb951297cb365c0c198595)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TypeVarTuple (GH-99412)
* Fix substitution of TypeVarTuple and ParamSpec together in user generics.
* Fix substitution of ParamSpec followed by TypeVarTuple in generic aliases.
* Check the number of arguments in substitution in user generics containing a
TypeVarTuple and one or more TypeVar.
(cherry picked from commit 8f2fb7dfe72c882e97e524ef7ce40ceb663cc27e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit a0bc75e2fdd53680cb147881bcb3754bd56aa2fa)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
| |
Fix subscription of type aliases containing bare generic types or types
like TypeVar: for example tuple[A, T][int] and tuple[TypeVar, T][int],
where A is a generic type, and T is a type variable.
(cherry picked from commit 0e15c31c7e9907fdbe38a3f419b669fed5bb3b33)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 9495360c7256938a6185838561cf416599b7e94f)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>.
Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>
(cherry picked from commit cb95cc24efecf32ad035318867b065a2b042d25a)
|
|
|
|
|
| |
(cherry picked from commit 45c89358b71e4638455e75ba6e60b42c511bbc2a)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
`RuntimeError` (GH-98351)
(cherry picked from commit 1ca6647f22794f0a0c982ecb03e764db76d51087)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit 4217393)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
| |
gh-96357: Improve `typing.get_overloads` coverage (GH-96358)
(cherry picked from commit 675e3470ccf3804a36a9cd451b813e9bd655aeb3)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
./python.exe -m test -R : test.test_typing would fail, apparently
because the dictionary used in the @patch decorator was modified.
(cherry picked from commit f0d9136c69b4ed32bfb3096f926da098623a7072)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit f177f6f29b069f522a0b3ba44eaae19852b6d2b0)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
(cherry picked from commit 75177358a62afeabd1d3aa0e9f395c2b9d4495ca)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
| |
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
(cherry picked from commit 6442a9dd212fa18343db21849cf05c0181662c1f)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 75cb3abc3bf10c7be3b374bfb4c060c36d251411)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
TypeVar and TypeVarTuple parameters (alt) (GH-93412) (GH-93746)
For example:
A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]
A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
(cherry picked from commit 3473817106c23eca7341c931453da0341c367e1d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
(GH-93346)
For example: tuple[*Ts, list[T]][int, str, bool]
(cherry picked from commit f545fc955aeb701ae4e73b07ff2283f823d857b8)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-92335) (#92484)
* gh-91162: Fix substitution of unpacked tuples in generic aliases (GH-92335)
(cherry picked from commit 9d25db9db1617f012d7dba118b5b8f2b9e25e116)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Regenerate ABI file
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
|
|
|
|
|
| |
(GH-92582)
(cherry picked from commit 4739997e141c4c84bd2241d4d887c3c658d92700)
Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>
|
|
|
|
| |
(GH-92304)
|
|
|
|
|
|
| |
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
This mirrors logic in typing.get_args. The trickiness comes from how we
flatten args in collections.abc.Callable, see
https://bugs.python.org/issue42195
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Matthew Rahtz <mrahtz@gmail.com>
|
|
|
| |
Fixes #92064
|