summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_genericalias.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-126012: Add `__class_getitem__` to `memoryview` (#126013)Brian Schubert2024-10-271-1/+1
| | | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* gh-123341: Support `tkinter.Event` type subcript (#123353)Yoda2024-09-011-0/+6
| | | | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-110209: Add __class_getitem__ for generator and coroutine (#110212)James Hilton-Balfe2024-05-071-1/+2
|
* gh-107431: Make `multiprocessing.managers.{DictProxy,ListProxy}` generic ↵Nikita Sobolev2023-11-101-2/+4
| | | | | | | | (#107433) Make `multiprocessing.managers.{DictProxy,ListProxy}` generic for type annotation use. `ListProxy[str]` for example. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-105486: Change the `repr` of `ParamSpec` list of args in `GenericAlias` ↵Nikita Sobolev2023-07-011-0/+8
| | | | (#105488)
* gh-103880: Fix `assertRaises` usage in `test_genericalias` (GH-103916)Nikita Sobolev2023-04-271-0/+3
|
* gh-99509: Add `__class_getitem__` to `multiprocessing.queues.Queue` (#99511)Nikita Sobolev2022-12-271-1/+6
|
* gh-98658: Add __class_getitem__ to array.array (#98661)Jelle Zijlstra2022-11-011-1/+3
| | | Closes #98658
* GH-87390: Add remaining tests for PEP 646 (#98267)Matthew Rahtz2022-10-251-51/+10
| | | Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* Add __class_getitem__ to csv.DictReader and csv.DictWriter (#92393)Marc Mueller2022-05-081-1/+3
|
* gh-92261: Disallow iteration of Union (and other special forms) (GH-92262)Matthew Rahtz2022-05-081-0/+20
|
* gh-87390: Fix starred tuple equality and pickling (GH-92337)Serhiy Storchaka2022-05-051-0/+3
|
* gh-87390: Add __unpacked__ attribute to types.GenericAlias (#92059)Jelle Zijlstra2022-05-021-0/+6
|
* gh-92128: Add `__class_getitem__` to `logging.LoggerAdapter` and ↵Alex Waygood2022-05-021-0/+2
| | | | | `logging.StreamHandler` (#92129) Closes #92128
* bpo-43224: typing: Add tests for pickling and copying of unpacked native ↵Matthew Rahtz2022-04-051-17/+56
| | | | tuple (GH-32159)
* bpo-43224: Implement PEP 646 changes to genericaliasobject.c (GH-31019)Matthew Rahtz2022-03-121-0/+90
| | | | | | | Specifically, prepare for starring of tuples via a new genericalias iter type. GenericAlias also partially supports the iterator protocol after this change. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-46927: Include the type's name in the error message for subscripting ↵Serhiy Storchaka2022-03-051-2/+2
| | | | non-generic types (GH-31694)
* bpo-40280: Address more test failures on Emscripten (GH-31050)Christian Heimes2022-02-051-5/+12
| | | Co-authored-by: Brett Cannon <brett@python.org>
* bpo-45359: Support TopologicalSorter type subscript (GH-28714)Jacob Hayes2021-12-081-0/+2
| | | | | | | | | | | | * Support TopologicalSorter type subscript * 📜🤖 Added by blurb_it. * Add TopologicalSorter to GenericAlias tests * Update Misc/NEWS.d/next/Library/2021-10-03-22-27-35.bpo-45359.LX_uxe.rst Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-45167: Fix deepcopying of GenericAlias (GH-28324)Serhiy Storchaka2021-09-151-5/+25
|
* bpo-44794: Merge tests for typing.Callable and collection.abc.Callable ↵Serhiy Storchaka2021-07-311-90/+0
| | | | (GH-27507)
* bpo-41559: Change PEP 612 implementation to pure Python (#25449)Ken Jin2021-04-281-0/+17
|
* bpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing (#23702)kj2020-12-241-0/+21
|
* bpo-42195: Override _CallableGenericAlias's __getitem__ (GH-23915)kj2020-12-241-0/+6
| | | Added `__getitem__` for `_CallableGenericAlias` so that it returns a subclass (itself) of `types.GenericAlias` rather than the default behavior of returning a plain `types.GenericAlias`. This fixes `repr` issues occuring after `TypeVar` substitution arising from the previous behavior.
* bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and ↵kj2020-12-131-1/+57
| | | | typing (GH-23060)
* bpo-42576: Raise TypeError when passing in keyword arguments to GenericAlias ↵kj2020-12-051-0/+5
| | | | | | | | | (GH-23656) Use `_PyArg_NoKeywords` instead of `_PyArg_NoKwnames` when checking the `kwds` tuple when creating `GenericAlias`. This fixes an interpreter crash when passing in keyword arguments to `GenericAlias`'s constructor. Needs backport to 3.9. Automerge-Triggered-By: GH:gvanrossum
* bpo-42332: Add weakref slot to types.GenericAlias (GH-23250)kj2020-11-161-38/+48
| | | Automerge-Triggered-By: GH:gvanrossum
* bpo-39481: Fix duplicate SimpleQueue type in test_genericalias.py (GH-22619)Saiyang Gou2020-10-091-2/+2
| | | | | There are two different `SimpleQueue` types imported (from `multiprocessing.queues` and `queue`) in `Lib/test/test_genericalias.py`, the second one shadowing the first one, making the first one not actually tested. Fix by using different names. Automerge-Triggered-By: @gvanrossum
* bpo-41780: Fix __dir__ of types.GenericAlias (GH-22262)Batuhan Taskaya2020-09-151-0/+5
| | | Automerge-Triggered-By: @gvanrossum
* bpo-41477: Make ctypes optional in test_genericalias (GH-21766)Victor Stinner2020-08-071-38/+42
|
* bpo-39481: remove generic classes from ipaddress/mmap (GH-20045)Batuhan Taskaya2020-05-121-4/+0
| | | These were added by mistake (see https://bugs.python.org/issue39481#msg366288).
* bpo-40408: Fix support of nested type variables in GenericAlias. (GH-19836)Serhiy Storchaka2020-05-041-7/+34
|
* bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425)Ethan Smith2020-04-141-1/+7
|
* bpo-39481: Make weakref and WeakSet generic (GH-19497)Ethan Smith2020-04-141-0/+2
|
* bpo-39481: Make functools.cached_property, partial, partialmethod generic ↵Ethan Smith2020-04-141-0/+2
| | | | (#19427)
* bpo-39481: fix test_genericalias on Android (GH-19469)Chih-Hsuan Yen2020-04-131-1/+7
| | | | | | | Android bionic does not implement shm_open/shm_unlink [1]. As a result _posixshmem extension does not exist and multiprocessing.shared_memory cannot be imported. [1] https://android.googlesource.com/platform/bionic/+/master/docs/status.md
* bpo-39481: PEP 585 for a variety of modules (GH-19423)Batuhan Taşkaya2020-04-101-0/+21
| | | | | | | | | | - concurrent.futures - ctypes - http.cookies - multiprocessing - queue - tempfile - unittest.case - urllib.parse
* bpo-39481: PEP 585 for difflib, filecmp, fileinput (#19422)Ethan Smith2020-04-101-0/+6
|
* bpo-39481: PEP 585 for enumerate, AsyncGeneratorType, mmap (GH-19421)Ethan Smith2020-04-101-4/+5
|
* bpo-39481: PEP 585 for ipaddress.py (GH-19418)Batuhan Taşkaya2020-04-101-0/+4
|
* Generic itertools.chain (GH-19417)Ethan Smith2020-04-101-1/+3
|
* bpo-39481: Make os.DirEntry generic (GH-19415)Batuhan Taşkaya2020-04-071-1/+2
|
* bpo-39481: Implementation for PEP 585 (#18239)Guido van Rossum2020-04-071-0/+214
This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`.