Commit Graph

306 Commits

Author SHA1 Message Date
Ken Jin efb1f0918f
bpo-42740: Support PEP 604, 612 for typing.py get_args and get_origin (GH-23942) 2020-12-28 18:26:19 -08:00
Ken Jin 4140f10a16
bpo-42740: Fix get_args for PEP 585 collections.abc.Callable (GH-23963)
PR 1/2. Needs backport to 3.9.
2020-12-28 12:06:19 -08:00
kj 73607be686
bpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing (#23702) 2020-12-23 20:33:48 -08:00
kj 463c7d3d14
bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and typing (GH-23060) 2020-12-13 10:38:24 -08:00
Alex Grönholm 67b769f515
bpo-42059: Fix required/optional keys for TypedDict(..., total=False) (GH-22736) 2020-12-10 13:49:05 -08:00
Yurii Karabas 1b54077ff6
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)
Fix hash implementation of `typing.Literal`.

Update docs regarding `typing.Litaral` caching.

Base implementation was done in PR #23294.
2020-11-19 08:17:38 -08:00
Yurii Karabas f03d318ca4
bpo-42345: Fix three issues with typing.Literal parameters (GH-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.
2020-11-16 18:23:19 -08:00
kj 1f7dfb277e
bpo-42233: Correctly repr GenericAlias when used with typing module (GH-23081)
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
2020-11-01 10:13:38 -08:00
Mikhail Golubev 4f3c25043d
bpo-41923: PEP 613: Add TypeAlias to typing module (#22532)
This special marker annotation is intended to help in distinguishing
proper PEP 484-compliant type aliases from regular top-level variable
assignments.
2020-10-07 14:44:31 -07:00
Batuhan Taskaya 044a1048ca
bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)
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).
2020-10-06 13:03:02 -07:00
Patrick Reader 0705ec8a14
bpo-41792: Add is_typeddict function to typing.py (GH-22254)
Closes issue41792.

Also closes https://github.com/python/typing/issues/751.
2020-09-15 21:58:32 -07:00
Maggie Moss 1b4552c5e8
bpo-41428: Implementation for PEP 604 (GH-21515)
See https://www.python.org/dev/peps/pep-0604/ for more information.

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2020-09-09 21:23:24 +01:00
Victor Stinner 0ee0b2938c
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21823)
Rename 5 test method names in test_codecs and test_typing.
2020-08-11 15:28:43 +02:00
wyfo 653f420b53
bpo-41341: Recursive evaluation of ForwardRef in get_type_hints (#21553)
The issue raised by recursive evaluation is infinite recursion with
recursive types. In that case, only the first recursive ForwardRef is
evaluated.
2020-07-22 12:47:28 -07:00
Zackery Spytz 7fed75597f
bpo-39168: Remove the __new__ method of typing.Generic (GH-21327)
Automerge-Triggered-By: @gvanrossum
2020-07-04 22:07:43 -07:00
Serhiy Storchaka 0122d48681
bpo-40397: Fix subscription of nested generic alias without parameters. (GH-20021) 2020-05-10 13:39:40 +03:00
Vlad Serebrennikov 138a9b9c2a
bpo-40389: Improve repr of typing.Optional (#19714) 2020-04-29 18:06:39 -07:00
Victor Stinner 57572b103e
bpo-40443: Remove unused imports in tests (GH-19805) 2020-04-30 01:48:37 +02:00
Serhiy Storchaka 6292be7adf
bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720) 2020-04-27 10:27:21 +03:00
Serhiy Storchaka 68b352a698
bpo-40396: Support GenericAlias in the typing functions. (GH-19718) 2020-04-26 21:21:08 +03:00
HongWeipeng a25a04fea5
bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)
https://bugs.python.org/issue39942
2020-04-20 21:01:53 +01:00
Serhiy Storchaka a2ec06938f
bpo-40185: Refactor typing.NamedTuple (GH-19371) 2020-04-08 10:59:04 +03:00
Guido van Rossum 48b069a003
bpo-39481: Implementation for PEP 585 (#18239)
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`.
2020-04-07 09:50:06 -07:00
Serhiy Storchaka 6fed3c8540
bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368) 2020-04-05 00:43:20 +03:00
Serhiy Storchaka a94e6272f1
bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363) 2020-04-04 21:31:30 +03:00
Furkan Önder 34b0598295
bpo-40086: Update/fix test_etree test case in test_typing (GH-19189) 2020-03-28 12:32:36 +00:00
Vlad Emelianov 10e87e5ef4
bpo-39627: Fix TypedDict totality check for inherited keys (#18503)
(Adapted from https://github.com/python/typing/pull/700)
2020-02-13 11:53:29 -08:00
Jakub Stasiak cf5b109dbb
bpo-39491: Merge PEP 593 (typing.Annotated) support (#18260)
* bpo-39491: Merge PEP 593 (typing.Annotated) support

PEP 593 has been accepted some time ago. I got a green light for merging
this from Till, so I went ahead and combined the code contributed to
typing_extensions[1] and the documentation from the PEP 593 text[2].

My changes were limited to:

* removing code designed for typing_extensions to run on older Python
  versions
* removing some irrelevant parts of the PEP text when copying it over as
  documentation and otherwise changing few small bits to better serve
  the purpose
* changing the get_type_hints signature to match reality (parameter
  names)

I wasn't entirely sure how to go about crediting the authors but I used
my best judgment, let me know if something needs changing in this
regard.

[1] 8280de241f/typing_extensions/src_py3/typing_extensions.py
[2] 17710b8798/pep-0593.rst
2020-02-04 17:10:19 -08:00
Zac Hatfield-Dodds 665ad3dfa9 Better runtime TypedDict (GH-17214)
This patch enables downstream projects inspecting a TypedDict subclass at runtime to tell which keys are optional.

This is essential for generating test data with Hypothesis or validating inputs with typeguard or pydantic.
2019-11-24 10:48:48 +00:00
benedwards14 0aca3a3a1e bpo-37838: get_type_hints for wrapped functions with forward reference (GH-17126)
https://bugs.python.org/issue37838
2019-11-21 17:24:58 +00:00
Serhiy Storchaka 13abda4100
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641) 2019-10-08 16:29:52 +03:00
Serhiy Storchaka 8fc5839a9d
bpo-38191: Turn warnings into errors in NamedTuple() and TypedDict(). (GH-16238) 2019-09-17 22:41:55 +03:00
Serhiy Storchaka 2bf31ccab3
bpo-38191: Accept arbitrary keyword names in NamedTuple() and TypedDict(). (GH-16222)
This includes such names as "cls", "self", "typename", "_typename",
"fields" and "_fields".
Passing positional arguments by keyword is deprecated.
2019-09-17 21:22:00 +03:00
Zackery Spytz d057b896f9 bpo-37953: Fix deprecation warnings in test_typing (GH-16133)
self.assertEquals() is deprecated.

```
./python -We -m test test_typing
Run tests sequentially
0:00:00 load avg: 0.23 [1/1] test_typing
test test_typing failed -- Traceback (most recent call last):
  File "/home/lubuntu2/cpython/Lib/test/test_typing.py", line 2382, in test_forward_equality_gth
    self.assertEquals(Union[c1, c1_gth], Union[c1])
  File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 1390, in deprecated_func
    warnings.warn(
DeprecationWarning: Please use assertEqual instead.

test_typing failed

== Tests result: FAILURE ==

1 test failed:
    test_typing

Total duration: 140 ms
Tests result: FAILURE
```



https://bugs.python.org/issue37953
2019-09-14 00:42:56 -07:00
plokmijnuhby e082e7cbe4 bpo-37953: Fix ForwardRef hash and equality checks (GH-15400)
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
2019-09-13 20:40:54 +01:00
Divij Rajkumar 692a0dc915 bpo-38008: Move builtin protocol whitelist to mapping instead of list (GH-15647)
Fixes https://bugs.python.org/issue38008
2019-09-12 11:13:51 +01:00
Ivan Levkivskyi 8889627b53 bpo-28556: Add a regression test to typing (GH-15396)
This adds a regression test for the issue found in the Python 2 backport, see https://github.com/python/typing/issues/656


https://bugs.python.org/issue28556
2019-08-22 10:48:01 -07:00
Benjamin Peterson 910b3fcb01
closes bpo-33758: Skip test_get_type_hints_modules_forwardref. (GH-13977)
This test "works" if things are run in the right order, so it's better to use @skip than @expectedFailure here.
2019-06-11 09:18:31 -07:00
Ivan Levkivskyi 4c23aff065
bpo-29262: Add get_origin() and get_args() introspection helpers to typing (GH-13685)
This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in `typing_inspect` on PyPI, I propose to add these two most commonly used functions: `get_origin()` and `get_args()`. These are essentially thin public wrappers around private APIs: `__origin__` and `__args__`.

As discussed in the issue and on the typing tracker, exposing some public helpers instead of `__origin__` and `__args__` directly will give us more flexibility if we will decide to update the internal representation, while still maintaining backwards compatibility.

The implementation is very simple an is essentially a copy from `typing_inspect` with one exception: `ClassVar` was special-cased in `typing_inspect`, but I think this special-casing doesn't really help and only makes things more complicated.
2019-05-31 00:10:07 +01:00
Anthony Sottile d30da5dd9a bpo-36983: Fix typing.__all__ and add test for exported names (GH-13456)
https://bugs.python.org/issue36983
2019-05-29 11:19:37 -07:00
Ivan Levkivskyi 74d7f76e2c
bpo-37058: PEP 544: Add Protocol to typing module (GH-13585)
I tried to get rid of the `_ProtocolMeta`, but unfortunately it didn'y work. My idea to return a generic alias from `@runtime_checkable` made runtime protocols unpickleable. I am not sure what is worse (a custom metaclass or having some classes unpickleable), so I decided to stick with the status quo (since there were no complains so far). So essentially this is a copy of the implementation in `typing_extensions` with two modifications:
* Rename `@runtime` to `@runtime_checkable` (plus corresponding updates).
* Allow protocols that extend `collections.abc.Iterable` etc.
2019-05-28 08:40:15 +01:00
Ivan Levkivskyi 2f0bfd27a5
Add one more test for typing.Final (GH-13588) 2019-05-27 00:54:13 +01:00
Ivan Levkivskyi 135c6a56e5
bpo-37049: PEP 589: Add TypedDict to typing module (GH-13573)
The implementation is straightforward and essentially is just copied from `typing_extensions`.
2019-05-26 09:39:24 +01:00
Ivan Levkivskyi b891c465bb
bpo-37046: PEP 586: Add Literal to typing module (#13572)
The implementation is straightforward and essentially is just copied from `typing_extensions`.
2019-05-26 09:37:48 +01:00
Ivan Levkivskyi f367242d10
bpo-37045: PEP 591: Add final qualifiers to typing module (GH-13571)
The implementation is straightforward, it just mimics `ClassVar` (since the latter is also a name/access qualifier, not really a type). Also it is essentially copied from `typing_extensions`.
2019-05-26 09:37:07 +01:00
Paul Dagnelie 4c7a46eb3c bpo-36972: Add SupportsIndex (GH-13448)
In order to support typing checks calling hex(), oct() and bin() on user-defined classes, a SupportIndex protocol is required. The ability to check these at runtime would be good to add for completeness sake. This is pretty much just a copy of SupportsInt with the names tweaked.
2019-05-22 15:23:01 +01:00
Andrew Svetlov 68b34a7204 bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)
The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is.


https://bugs.python.org/issue36921
2019-05-16 07:52:10 -07:00
Ismo Toijala 68b56d02ef bpo-35341: Add generic version of OrderedDict to typing (GH-10850) 2018-12-02 15:53:14 +00:00
Serhiy Storchaka 961360923e
bpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380) 2018-07-21 22:46:26 +03:00
Ivan Levkivskyi f65e31fee3
bpo-28556: Don't simplify unions at runtime (GH-6841) 2018-05-18 16:00:38 -07:00
Nina Zakharenko 2d2d3b170b Fix ClassVar as string fails when getting type hints (GH-6824) 2018-05-16 12:27:03 -04:00
Ivan Levkivskyi b551e9f0ff
Fix a bug in Generic.__new__ (GH-6758) 2018-05-10 23:10:10 -04:00
Ivan Levkivskyi 43d12a6bd8
bpo-28556: Minor fixes for typing module (GH-6732)
This also fixes https://bugs.python.org/issue33420
2018-05-09 02:23:46 +01:00
Ivan Levkivskyi 2a363d2930
bpo-32873: Remove a name hack for generic aliases in typing module (GH-6376)
This removes a hack and replaces it with a proper
mapping {'list': 'List', 'dict': 'Dict', ...}.
2018-04-05 01:25:15 +01:00
Ivan Levkivskyi ee566fe526
Call super in Generic.__init_subclass__ (#6356) 2018-04-04 17:00:15 +01:00
Ivan Levkivskyi 834940375a
bpo-32873: Treat type variables and special typing forms as immutable by copy and pickle (GH-6216)
This also fixes python/typing#512
This also fixes python/typing#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  # 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
2018-03-26 23:01:12 +01:00
Ivan Levkivskyi 03e3c340a0
bpo-31333: Re-implement ABCMeta in C (#5273)
This adds C versions of methods used by ABCMeta that
improve performance of various ABC operations.
2018-02-18 12:41:58 +00:00
Ivan Levkivskyi d911e40e78
bpo-32226: PEP 560: improve typing module (#4906)
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.
2018-01-20 11:23:59 +00:00
Ivan Levkivskyi 29bc193210 [bpo-28556] Minor fixes for typing module (#4710) 2017-12-04 21:43:58 -05:00
Éric Araujo 03b9537dc5 bpo-31567: more decorator markup fixes in docs (GH-3959) (#3966) 2017-10-12 12:28:55 -04:00
Łukasz Langa f350a268a7 bpo-28556: typing.get_type_hints: better globalns for classes and modules (#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.
2017-09-14 14:33:00 -04:00
Ivan Levkivskyi 65bc62052f bpo-28556: Minor updates to typing module (#3550)
* Copy changes to typing from upstream repo
* Add NEWS entry
2017-09-13 19:25:15 -04:00
Ivan Levkivskyi 29fda8db16 bpo-28556: Updates to typing module (#2076)
This PR contains two updates to typing module:

- Support ContextManager on all versions (original PR by Jelle Zijlstra).
- Add generic AsyncContextManager.
2017-06-10 12:57:56 -07:00
Ivan Levkivskyi f06e0218ef bpo-28556: Routine updates to typing (#1366)
- Add NoReturn type
- Use WrapperDescriptorType (original PR by Jim Fasarakis-Hilliard)
- Minor bug-fixes
2017-05-02 10:14:07 -07:00
Serhiy Storchaka 2e576f5aec bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263) 2017-04-24 09:05:00 +03:00
Ivan Levkivskyi 365cb5bb90 bpo-28556: Fix regression that sneaked into recent typing updates (GH-270) 2017-02-24 09:28:26 -08:00
Ivan Levkivskyi abb3b8ad94 Update to typing: treat subscripted generics as proxies (#265) 2017-02-23 19:03:28 -08:00
Ivan Levkivskyi b692dc8475 bpo-28556: Various updates to typing (#28)
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
2017-02-13 13:50:14 -08:00
Guido van Rossum 95919c096c Issue #28556: Allow defining methods in NamedTuple class syntax (#362) 2017-01-22 17:47:20 -08:00
Guido van Rossum d7adfe129c Issue #28556: various style fixes for typing.py 2017-01-22 17:43:53 -08:00
Guido van Rossum e9ed560fce Issue #29198: add AsyncGenerator (Jelle Zijlstra) 2017-01-18 13:10:31 -08:00
Guido van Rossum 3c268be885 Issue #28556: allow default values in class form of NamedTuple -- Jelle Zijlstra 2017-01-18 08:03:50 -08:00
Guido van Rossum 83ec302e52 Issue #28556: merge 5 more typing changes from upstream (#340, #344, #348, #349, #350) 2017-01-17 20:43:28 -08:00
Raymond Hettinger 80490525e0 Issue #29011: Fix an important omission by adding Deque to the typing module. 2017-01-16 22:42:37 -08:00
Guido van Rossum 61f0a0261f Issue #28790: Fix error when using Generic and __slots__ (Ivan L) 2016-11-29 09:46:21 -08:00
Guido van Rossum ca4b252fba Issue #28556: two more small upstream changes by Ivan Levkivskyi (#329, #330) 2016-11-19 10:32:41 -08:00
Guido van Rossum 2f84144235 Issue #28556: Allow keyword syntax for NamedTuple (Ivan Levkivskyi) (upstream #321) 2016-11-15 09:48:06 -08:00
Guido van Rossum f9099de894 Issue #28649: fix-typing-test-v2.diff 2016-11-09 13:18:59 -08:00
Guido van Rossum 991d14fee1 Issue #28556: More typing.py updates from upstream. 2016-11-09 13:12:51 -08:00
Guido van Rossum 62fe1bb983 Issue #28556: updates to typing.py (add Coroutine, prohibit Generic[T]()) 2016-10-29 16:05:26 -07:00
Guido van Rossum b7dedc89f1 Issue #28556: updates to typing.py (fix copy, deepcopy, pickle) 2016-10-29 12:44:29 -07:00
Guido van Rossum 5fc25a873c Issue #28556: updates to typing.py 2016-10-29 08:54:56 -07:00
Guido van Rossum 3b557991d4 Two minor typing.py fixes (upstream #305) 2016-10-21 17:30:29 -07:00
Guido van Rossum ac353dfa14 Issue #28482: Skip a few test_typing tests if asyncio unavailable 2016-10-21 16:12:17 -07:00
Guido van Rossum 7ef22d6b96 Sync typing.py from upstream 2016-10-21 14:27:58 -07:00
Guido van Rossum e259267e52 Merge further typing.py changes from upstream. 2016-10-08 20:27:22 -07:00
Guido van Rossum b47c9d29d7 More updates from upstream typing.py 2016-10-03 08:40:50 -07:00
Guido van Rossum 4cefe74aef Update typing.py and test_typing.py from upstream (https://github.com/python/typing) 2016-09-27 15:20:12 -07:00
Guido van Rossum 0a6976da10 Issue #28079: Update typing and test typing from python/typing repo.
Ivan Levkivskyi (3.5 version)
2016-09-11 15:34:56 -07:00
Guido van Rossum efa798d1ba A new version of typing.py from https://github.com/python/typing. 2016-08-23 11:01:50 -07:00
Guido van Rossum 91185fe028 Sync typing.py with upstream.
(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).
2016-06-08 11:19:11 -07:00
Guido van Rossum eb9aca3c07 Added Type[C] implementation to typing.py. 2016-05-24 16:38:22 -07:00
Guido van Rossum 1cea70f08c Fix #27014 -- infinite recursion using typing.py. 2016-05-18 08:35:00 -07:00
Zachary Ware 75b1bdcafa Replace assert statements with self.assertXxx() calls
Sync with upstream, see github.com/python/typing/pull/205
2016-04-19 11:49:37 -05:00
Guido van Rossum 5abcbb3ee5 typing.py: Consider ellipsis in TupleMeta.__eq__. By Kalle Tuure. github.com/python/typing/pull/201. 2016-04-18 07:37:41 -07:00
Guido van Rossum 6aafbd433d Sync test_typing.py with upstream git repo (typing.py was already synced). 2016-04-17 17:52:05 -07:00
Guido van Rossum bd5b9a0742 Many changes from the upstream repo (https://github.com/python/typing).
This syncs to rev 7b43ada77821d23e55e3a4b35f6055a59b9e1ad7 there.

Summary:

- Add typing.DefaultDict (as a generic variant of collections.defaultdict).

- Use collections.Reversible if it exists (only relevant for Python 3.6).

- Revamped generic class behavior to conform to updated PEP 484.

- Improve speed of Generic.__new__.

- Make sure __init__ is called for new Generic instances. Fix issue #26391.

- Refactor async support to be compatible with 3.2, 3.3, 3.4.

- Remove 'io' and 're' from __all__ (they still exist, just not
  included by "import *"). Fix issue #26234.

- Change @overload -- you can now use it outside stubs (you still
  cannot call the decorated function though).
2016-04-05 08:28:52 -07:00
Guido van Rossum f17c20076c Add Awaitable, AsyncIterable, AsyncIterator to typing.py. 2015-12-03 17:31:24 -08:00
Serhiy Storchaka 6d9e92396f Issue #25665: Test pickling with all protocols in test_typing. 2015-11-20 18:33:02 +02:00
Guido van Rossum 557d1eb0f3 Issue #25665: Make NamedTuple picklable. 2015-11-19 08:16:31 -08:00
Guido van Rossum 05e3090e3a Remove unused imports from test_typing.py. 2015-11-18 21:18:51 -08:00
Guido van Rossum bb7c57c6cd Issue #25472: In B[<type>], insert B in front of __bases__, to make the __dict__ descriptor work. 2015-11-18 21:12:58 -08:00
Guido van Rossum ca636eac88 Issue #25390: typing: Don't crash on Union[str, Pattern]. 2015-10-19 14:55:47 -07:00
Guido van Rossum 1b66910537 Fix issue #24635. 2015-09-04 12:15:54 -07:00
Guido van Rossum d70fe639c1 Issue #23973: Update typing.py from GitHub repo. 2015-08-05 12:11:06 +02:00
Guido van Rossum 46dbb7d103 Preliminary typing.py, anticipating provisional acceptance of PEP 484.
There area bunch of TODOs here, but the biggest (not mentioned in the
file) is that I'm going to take out __instancecheck__ and
__subclasscheck__.  However my personal schedule is such that I
probably won't have time for these before Larry tags beta 1.  But I
will try -- this commit is mostly to make sure that typing.py doesn't
completely miss the train.

PS. I'm tracking issues at https://github.com/ambv/typehinting/issues.
2015-05-22 10:14:11 -07:00