| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
|
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
| |
Remove also the _from_args() constructor.
|
|
|
| |
Automerge-Triggered-By: GH:pablogsal
|
|
|
| |
Remove direct support of typing types in the C code because they are already supported by defining methods __or__ and __ror__ in the Python code.
|
| |
|
|
|
|
| |
(GH-27247)
|
|
|
|
|
|
| |
(GH-27218)
A TypeError is now raised instead of returning NotImplemented.
|
| |
|
| |
|
|
|
|
|
|
| |
The result of `int | int` is now `int`.
Fix comparison of the union type with non-hashable objects.
`int | str == {}` no longer raises a TypeError.
|
|
|
|
|
|
| |
It no longer depends on the order of arguments.
hash(int | str) == hash(str | int)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
|
|
|
|
| |
int | TypeVar('T') returns now an instance of types.Union
instead of typing.Union.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-27120)
* Fix issubclass() for None.
E.g. issubclass(type(None), int | None) returns now True.
* Fix issubclass() for virtual subclasses.
E.g. issubclass(dict, int | collections.abc.Mapping) returns now True.
* Fix crash in isinstance() if the check for one of items raises exception.
|
|
|
|
| |
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in Union (GH-24059)
Previously this didn't raise an error. Now it will:
```python
from collections.abc import Callable
isinstance(int, list | Callable[..., str])
```
Also added tests in Union since there were previously none for stuff like ``isinstance(list, list | list[int])`` either.
Backport to 3.9 not required.
Automerge-Triggered-By: GH:gvanrossum
|
|
|
|
| |
typing (GH-23060)
|
|
|
|
| |
de-duplicating of GenericAlias (GH-23077)
|
|
|
| |
* Use Py_TYPE() rather than o->ob_type.
|
|
|
| |
It can silence arbitrary exceptions.
|
|
|
|
|
|
|
| |
Use Py_ssize_t type rather than int, to store lengths in
unionobject.c. Fix the warning:
Objects\unionobject.c(205,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use Py_ssize_t type rather than int, to store lengths in
unionobject.c. Fix warnings:
Objects\unionobject.c(189,71): warning C4244: '+=':
conversion from 'Py_ssize_t' to 'int', possible loss of data
Objects\unionobject.c(182,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data
Objects\unionobject.c(205,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data
Objects\unionobject.c(437,1): warning C4244: 'initializing':
conversion from 'Py_ssize_t' to 'int', possible loss of data
|
|
See https://www.python.org/dev/peps/pep-0604/ for more information.
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|