| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
(GH-27237) (#27246)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit bce1418541a64a793960182772f985f64afbfa1a)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
|
|
| |
(#27222)
(cherry picked from commit bf89ff96e6ba21bb52b8597b5e51e8ffc57e6589)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
This fixes TypedDict to work with get_type_hints and postponed evaluation of annotations across modules.
This is done by adding the module name to ForwardRef at the time the object is created and using that to resolve the globals during the evaluation.
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 889036f7ef7290ef15b6c3373023f6a35387af0c)
Co-authored-by: Germán Méndez Bravo <german.mb@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
with invalid `.__module__`. (GH-26862) (GH-26920)
(cherry picked from commit 7569c0fe91dfcf562dee8c29798ecda74d738aa8)
Co-authored-by: will-ca <willchencontact@gmail.com>
Automerge-Triggered-By: GH:gvanrossum
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-26013) (#26091)
Added two new attributes to ``_GenericAlias``:
* ``_typevar_types``, a single type or tuple of types indicating what types are treated as a ``TypeVar``. Used for ``isinstance`` checks.
* ``_paramspec_tvars ``, a boolean flag which guards special behavior for dealing with ``ParamSpec``. Setting it to ``True`` means this class deals with ``ParamSpec``.
Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit b2f3f8e3d81b0bb0ba18f563d82c28ba133c0790)
|
|
|
|
|
|
|
| |
(GH-26067)
(cherry picked from commit c40486a32d7e37b01ead94e701d69847f5b60e30)
Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
|
| |
|
|
|
| |
While surprising (searching globals before locals in one specific case), this is needed for backwards compatibility.
|
|
|
|
|
|
| |
(GH-25490)
This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
|
| |
|
|
|
|
|
| |
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: efahl <36704995+efahl@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
PR 1/2. Needs backport to 3.9.
|
| |
|
|
|
|
| |
typing (GH-23060)
|
| |
|
|
|
|
|
|
|
| |
Fix hash implementation of `typing.Literal`.
Update docs regarding `typing.Litaral` caching.
Base implementation was done in PR #23294.
|
|
|
|
|
|
|
| |
Literal equality no longer depends on the order of arguments.
Fix issue related to `typing.Literal` caching by adding `typed` parameter to `typing._tp_cache` function.
Add deduplication of `typing.Literal` arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Noticed by @serhiy-storchaka in the bpo. `typing`'s types were not showing the parameterized generic.
Eg. previously:
```python
>>> typing.Union[dict[str, float], list[int]]
'typing.Union[dict, list]'
```
Now:
```python
>>> typing.Union[dict[str, float], list[int]]
'typing.Union[dict[str, float], list[int]]'
```
Automerge-Triggered-By: GH:gvanrossum
|
|
|
|
|
| |
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
|
|
|
|
|
| |
The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions.
For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
|
|
|
|
|
| |
Closes issue41792.
Also closes https://github.com/python/typing/issues/751.
|
|
|
|
|
| |
See https://www.python.org/dev/peps/pep-0604/ for more information.
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
| |
Rename 5 test method names in test_codecs and test_typing.
|
|
|
|
|
|
| |
The issue raised by recursive evaluation is infinite recursion with
recursive types. In that case, only the first recursive ForwardRef is
evaluated.
|
|
|
| |
Automerge-Triggered-By: @gvanrossum
|
|
|
|
| |
(GH-20021)
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
https://bugs.python.org/issue39942
|