| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
`_collections_abc._CallableGenericAlias` (GH-102790)
This is a manual backport of https://github.com/python/cpython/pull/102722 but without `typing.py` changes and without `TypeVarTuple` case, because it was added in 3.11
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>
|
|
|
|
|
| |
(#102445) (#102452)
(cherry picked from commit 96e1022)
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
(cherry picked from commit a0bc75e2fdd53680cb147881bcb3754bd56aa2fa)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
(GH-98969)
Fix subscription of types.GenericAlias instances containing bare generic types:
for example tuple[A, T][int], where A is a generic type, and T is a type
variable.
|
|
|
|
|
| |
(cherry picked from commit 45c89358b71e4638455e75ba6e60b42c511bbc2a)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
| |
(cherry picked from commit 75cb3abc3bf10c7be3b374bfb4c060c36d251411)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 81fb3548be5a18bf40a6f4505a02cc7fb72c9c34)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-31061) (GH-31821)
(Cherry-picked from 32bf3597922ac3f613989582afa2bff43bea8a2f.)
GH-26091 added the _typevar_types and _paramspec_tvars instance
variables to _GenericAlias. However, they were not propagated
consistently. This commit addresses the most prominent deficiency
identified in bpo-46581 (namely their absence from
_GenericAlias.copy_with), but there could be others.
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 75d2d945b4e28ca34506b2d4902367b61a8dff82)
Co-authored-by: Gregory Beauregard <greg@greg.red>
|
|
|
|
|
| |
(cherry picked from commit 25c0b9d243b64ccd2eeab483089eaf7e4b4d5834)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `module` parameter carries semantic information about the forward ref.
Forward refs are different if they refer to different module even if they
have the same name. This affects the `__eq__`, `__repr__` and `__hash__` methods.
Co-authored-by: Andreas Hangauer <andreas.hangauer@siemens.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a)
Co-authored-by: aha79 <34090357+aha79@users.noreply.github.com>
Automerge-Triggered-By: GH:JelleZijlstra
|
|
|
|
|
| |
(cherry picked from commit d2d1d49eaccaa83eb8873ba15f2fc9562143bc56)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
(GH-31203) (GH-31210)
(cherry picked from commit c8b62bbe46e20d4b6dd556f2fa85960d1269aa45)
Co-authored-by: Gregory Beauregard <greg@greg.red>
|
|
|
|
|
|
|
| |
(#31175)
(cherry picked from commit 77b025be4a4cd5a3bfc1b1af560cc57e8e956c98)
Co-authored-by: Gregory Beauregard <greg@greg.red>
|
|
|
|
|
|
|
| |
(GH-31078) (GH-31182)
(cherry picked from commit 067c03bf40d13393209f0138fa9c4d5980c4ff8a)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit 3da5526136034188185d6a3fdba71e2b56577ee2)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 4c0612ad00ba45dbea2a86f7db6d21546cf243f8)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously this didn't matter because there weren't any valid code paths
that could trigger a type check with a special form, but after the bug
fix for `Annotated` wrapping special forms it's now possible to annotate
something like `Annotated['ClassVar[int]', (3, 4)]`. This change would
also be needed for proposed future changes, such as allowing `ClassVar`
and `Final` to nest each other in dataclasses.
(cherry picked from commit ced50051bb752a7c1e616f4b0c001f37f0354f32)
Co-authored-by: Gregory Beauregard <greg@greg.red>
|
|
|
|
|
|
|
|
|
|
|
| |
parameter expressions (GH-27518)
* Substitution with a list of types returns now a tuple of types.
* Substitution with Concatenate returns now a Concatenate with
concatenated lists of arguments.
* Substitution with Ellipsis is not supported.
(cherry picked from commit ecfacc362dd7fef7715dcd94f2e2ca6c622ef115)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit d0c690b5f85c679de6059cf353fe0524e905530e)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
| |
Partially reverts 65b88d5e01c845c0cfa3ff61bc8b2faec8f67a57.
|
|
|
|
|
|
|
|
| |
We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.
Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit e1abffca45b60729c460e3e2ad50c8c1946cfd4e)
Co-authored-by: Gregory Beauregard <greg@greg.red>
|
|
|
|
|
|
|
|
| |
(GH-30641) (GH-30697)
Use `__name__`
(cherry picked from commit 2792d6d18eab3efeb71e6397f88db86e610541f1)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit 65b88d5e01c845c0cfa3ff61bc8b2faec8f67a57)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit 263c0dd16017613c5ea2fbfc270be4de2b41b5ad)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
|
|
|
|
| |
`_SpecialGenericAlias` (GH-30640) (GH-30694)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 0a49148e87cca11e3820cbff2abfd316986a68c6)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Automerge-Triggered-By: GH:Fidget-Spinner
|
|
|
|
|
| |
(cherry picked from commit 32398294fb3fcf4ee74da54722fd0221c4e6cb74)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit 1de60155d5d01be2924e72fb68dd13d4fd00acd7)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
`dir()` (GH-29962)
(cherry picked from commit d6e13747161d7b634b47d2d3d212ed3be4a21fab)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
|
|
|
|
|
| |
Literal[True, 2] is no longer equal to Literal[1, 2].
(cherry picked from commit 634984d7dbdd91e0a51a793eed4d870e139ae1e0)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
| |
(GH-28571)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
(cherry picked from commit f56268a2cd38b3fe2be1e4361d3d8b581e73559b)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 784905dbeff68cf788bbeefe0a675af1af04affc)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
|
|
| |
subclass' __init__ (GH-28206) (GH-28232)
(cherry picked from commit c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
|
|
|
| |
forms in `typing` (GH-27710)
This was a Python 3.9 regression.
(cherry picked from commit a3a4d20d6798aa2975428d51f3a4f890248810cb)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 23384a1749359f0ae7aaae052073d44b59e715a1)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
| |
Because setting non-empty _name affects behavior of other code.
In most cases __name__ can be derived from __origin__.__name__.
(cherry picked from commit 4ceec495598e78f0776dd46d511dcc612a434dc3)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
| |
for specialforms (GH-27614)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 8bdf12e99a3dc7ada5f85bba79c2a9eb9931f5b0)
Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 3875a6954741065b136650db67ac533bc70a3eac)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
Non-protocol subclasses of protocol ignore now the __init__ method
inherited from protocol base classes.
(cherry picked from commit 043cd60abed09edddc7185bcf7d039771acc734d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
type with ParamSpec parameter. (GH-27515)
For example Callable[P, T][[int], str, float] will now raise an error.
Use also term "arguments" instead of "parameters" in error
message for too few/many arguments.
(cherry picked from commit f92b9133ef67e77605cbd315b6b6c81036ce110e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
(GH-27507)
(cherry picked from commit be4cb9089aaf58d5f90da5f9fa66dc3c6763b5a2)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 7b975f81e4dba70a42c6279539a7fcfe4211b4c0)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
|
| |
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 8182c8329c709f42218a8a17d81639ece5b7b627)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 2b8ad9e6c5f0a66e9ca2d15f85336d8a3eefefb0)
Co-authored-by: Hasan <hasan.aleeyev@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit a22b05da87bdfb081d6aaecfce136ae8dbb8680c)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
|
|
|
| |
(GH-27326)
Make NewType pickleable by name.
(cherry picked from commit e89ef0ad2a299770a88ece8f7a316f7d3eb65c9f)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 4868b94c6089d457673b1ba5b5b64c2f38c435af)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 965dd76e9060e27e2253ba8c8d21a142b178720d)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|