summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_typing.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37953: Fix ForwardRef hash and equality checks (GH-15400) (GH-18751)Ryan Rowe2020-03-031-0/+116
| | | | | | | | | Ideally if we stick a ForwardRef in a dictionary we would like to reliably be able to get it out again. https://bugs.python.org/issue37953 (cherry picked from commit e082e7c) Co-authored-by: plokmijnuhby <39633434+plokmijnuhby@users.noreply.github.com>
* bpo-37838: get_type_hints for wrapped functions with forward reference ↵Miss Islington (bot)2019-11-211-0/+15
| | | | | | | | (GH-17126) https://bugs.python.org/issue37838 (cherry picked from commit 0aca3a3a1e68b4ca2d334ab5255dfc267719096e) Co-authored-by: benedwards14 <53377856+benedwards14@users.noreply.github.com>
* [3.7] bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. ↵Serhiy Storchaka2019-10-091-7/+21
| | | | | | (GH-16641). (GH-16674) (cherry picked from commit 13abda41003daf599587991d8291f0dacf6e9519)
* [3.7] bpo-38191: Accept arbitrary keyword names in NamedTuple(). (GH-16222) ↵Serhiy Storchaka2019-09-171-0/+28
| | | | | | | (GH-16239) This includes such names as "cls", "self", "typename" and "fields". (cherry picked from commit 2bf31ccab3d17f3f35b42dca97f99576dfe2fc7d)
* closes bpo-33758: Skip test_get_type_hints_modules_forwardref. (GH-13977)Miss Islington (bot)2019-06-111-2/+2
| | | | | | This test "works" if things are run in the right order, so it's better to use @skip than @expectedFailure here. (cherry picked from commit 910b3fcb01c29f18ffd53086e36cd2cb9e5fae55) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.7] bpo-36983: Fix typing.__all__ and add test for exported names ↵Anthony Sottile2019-05-301-0/+24
| | | | | | | (GH-13456) (GH-13662) https://bugs.python.org/issue36983 Fixes issue 36983
* bpo-35341: Add generic version of OrderedDict to typing (GH-10850)Miss Islington (bot)2018-12-021-0/+16
| | | | | (cherry picked from commit 68b56d02ef20479b87c65e523cf3dec1b7b77d40) Co-authored-by: Ismo Toijala <ismo.toijala@gmail.com>
* bpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380) (GH-8385)Miss Islington (bot)2018-07-221-2/+2
| | | | | (cherry picked from commit 961360923e7997a04833652623ea549b0dc02262) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-28556: Don't simplify unions at runtime (GH-6841) (GH-6979)Miss Islington (bot)2018-05-181-12/+12
| | | | | (cherry picked from commit f65e31fee3b55dfb6ed5398179d5c5d6b502dee5) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* Fix ClassVar as string fails when getting type hints (GH-6824) (#6912)Miss Islington (bot)2018-05-161-0/+24
| | | | | (cherry picked from commit 2d2d3b170bdebc085900bfa2a3bc81b5d132d0a8) Co-authored-by: Nina Zakharenko <nzakharenko@gmail.com>
* Fix a bug in Generic.__new__ (GH-6758)Miss Islington (bot)2018-05-111-0/+3
| | | | | (cherry picked from commit b551e9f0ff25018a5606465003e2c51c04f693a3) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* bpo-28556: Minor fixes for typing module (GH-6732)Miss Islington (bot)2018-05-091-0/+68
| | | | | | This also fixes https://bugs.python.org/issue33420 (cherry picked from commit 43d12a6bd82bd09ac189069fe1eb40cdbc10a58c) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* bpo-32873: Remove a name hack for generic aliases in typing module (GH-6376)Miss Islington (bot)2018-04-051-2/+3
| | | | | | | This removes a hack and replaces it with a proper mapping {'list': 'List', 'dict': 'Dict', ...}. (cherry picked from commit 2a363d2930e29ec6d8a774973ed5a4965f881f5f) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* Call super in Generic.__init_subclass__ (GH-6356)Miss Islington (bot)2018-04-041-0/+19
| | | | | (cherry picked from commit ee566fe526f3d069aa313578ee81ca6cbc25ff52) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* bpo-32873: Treat type variables and special typing forms as immutable by ↵Miss Islington (bot)2018-03-261-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | copy and pickle (GH-6216) This also fixes python/typingGH-512 This also fixes python/typingGH-511 As was discussed in both issues, some typing forms deserve to be treated as immutable by copy and pickle modules, so that: * copy(X) is X * deepcopy(X) is X * loads(dumps(X)) is X GH- pickled by reference This PR adds such behaviour to: * Type variables * Special forms like Union, Any, ClassVar * Unsubscripted generic aliases to containers like List, Mapping, Iterable This not only resolves inconsistencies mentioned in the issues, but also improves backwards compatibility with previous versions of Python (including 3.6). Note that this requires some dances with __module__ for type variables (similar to NamedTuple) because the class TypeVar itself is define in typing, while type variables should get module where they were defined. https://bugs.python.org/issue32873 (cherry picked from commit 834940375ae88bc95794226dd8eff1f25fba1cf9) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* bpo-31333: Re-implement ABCMeta in C (GH-5733)Ivan Levkivskyi2018-02-181-2/+2
| | | | This adds C versions of methods used by ABCMeta that improve performance of various ABC operations.
* bpo-32226: PEP 560: improve typing module (#4906)Ivan Levkivskyi2018-01-201-148/+90
| | | | This PR re-designs the internal typing API using the new PEP 560 features. However, there are only few minor changes in the public API.
* [bpo-28556] Minor fixes for typing module (#4710)Ivan Levkivskyi2017-12-051-2/+48
|
* bpo-31567: more decorator markup fixes in docs (GH-3959) (#3966)Éric Araujo2017-10-121-2/+2
|
* bpo-28556: typing.get_type_hints: better globalns for classes and modules ↵Łukasz Langa2017-09-141-7/+31
| | | | | | | | | | | | | | | (#3582) This makes the default behavior (without specifying `globalns` manually) more predictable for users, finds the right globalns automatically. Implementation for classes assumes has a `__module__` attribute and that module is present in `sys.modules`. It does this recursively for all bases in the MRO. For modules, the implementation just uses their `__dict__` directly. This is backwards compatible, will just raise fewer exceptions in naive user code. Originally implemented and reviewed at https://github.com/python/typing/pull/470.
* bpo-28556: Minor updates to typing module (#3550)Ivan Levkivskyi2017-09-131-0/+7
| | | | * Copy changes to typing from upstream repo * Add NEWS entry
* bpo-28556: Updates to typing module (#2076)Ivan Levkivskyi2017-06-101-3/+36
| | | | | | | This PR contains two updates to typing module: - Support ContextManager on all versions (original PR by Jelle Zijlstra). - Add generic AsyncContextManager.
* bpo-28556: Routine updates to typing (#1366)Ivan Levkivskyi2017-05-021-5/+46
| | | | | - Add NoReturn type - Use WrapperDescriptorType (original PR by Jim Fasarakis-Hilliard) - Minor bug-fixes
* bpo-30144: Import collections ABC from collections.abc rather than ↵Serhiy Storchaka2017-04-241-16/+16
| | | | collections. (#1263)
* bpo-28556: Fix regression that sneaked into recent typing updates (GH-270)Ivan Levkivskyi2017-02-241-0/+8
|
* Update to typing: treat subscripted generics as proxies (#265)Ivan Levkivskyi2017-02-241-0/+27
|
* bpo-28556: Various updates to typing (#28)Ivan Levkivskyi2017-02-131-25/+212
| | | | | | | | | | | | | | | various updates from upstream python/typing repo: - Added typing.Counter and typing.ChainMap generics - More flexible typing.NamedTuple - Improved generic ABC caching - More tests - Bugfixes - Other updates * Add Misc/NEWS entry * Add issue number
* Issue #28556: Allow defining methods in NamedTuple class syntax (#362)Guido van Rossum2017-01-231-5/+27
|
* Issue #28556: various style fixes for typing.pyGuido van Rossum2017-01-231-10/+21
|
* Issue #29198: add AsyncGenerator (Jelle Zijlstra)Guido van Rossum2017-01-181-0/+42
|
* Issue #28556: allow default values in class form of NamedTuple -- Jelle ZijlstraGuido van Rossum2017-01-181-0/+26
|
* Issue #28556: merge 5 more typing changes from upstream (#340, #344, #348, ↵Guido van Rossum2017-01-181-4/+33
| | | | #349, #350)
* Issue #29011: Fix an important omission by adding Deque to the typing module.Raymond Hettinger2017-01-171-0/+11
|
* Issue #28790: Fix error when using Generic and __slots__ (Ivan L)Guido van Rossum2016-11-291-0/+38
|
* Issue #28556: two more small upstream changes by Ivan Levkivskyi (#329, #330)Guido van Rossum2016-11-191-2/+19
|
* Issue #28556: Allow keyword syntax for NamedTuple (Ivan Levkivskyi) ↵Guido van Rossum2016-11-151-0/+14
| | | | (upstream #321)
* Issue #28649: fix-typing-test-v2.diffGuido van Rossum2016-11-091-3/+4
|
* Issue #28556: More typing.py updates from upstream.Guido van Rossum2016-11-091-16/+47
|
* Issue #28556: updates to typing.py (add Coroutine, prohibit Generic[T]())Guido van Rossum2016-10-291-1/+22
|
* Issue #28556: updates to typing.py (fix copy, deepcopy, pickle)Guido van Rossum2016-10-291-0/+19
|
* Issue #28556: updates to typing.pyGuido van Rossum2016-10-291-21/+136
|
* Two minor typing.py fixes (upstream #305)Guido van Rossum2016-10-221-1/+1
|
* Issue #28482: Skip a few test_typing tests if asyncio unavailableGuido van Rossum2016-10-211-7/+10
|
* Sync typing.py from upstreamGuido van Rossum2016-10-211-5/+91
|
* Merge further typing.py changes from upstream.Guido van Rossum2016-10-091-0/+79
|
* More updates from upstream typing.pyGuido van Rossum2016-10-031-29/+38
|
* Update typing.py and test_typing.py from upstream ↵Guido van Rossum2016-09-271-223/+114
| | | | (https://github.com/python/typing)
* Issue #28079: Update typing and test typing from python/typing repo.Guido van Rossum2016-09-111-2/+140
| | | | Ivan Levkivskyi (3.5 version)
* A new version of typing.py from https://github.com/python/typing.Guido van Rossum2016-08-231-1/+12
|
* Sync typing.py with upstream.Guido van Rossum2016-06-081-2/+36
| | | | | | | | | (Upstream is https://github.com/python/typing) - Add TYPE_CHECKING (false at runtime, true in type checkers) (upstream #230). - Avoid error on Union[xml.etree.cElementTree.Element, str] (upstream #229). - Repr of Tuple[()] should be 'Tuple[()]' (upstream #231). - Add NewType() (upstream #189).