Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | gh-112345: `typing.Protocol`: Let failed subclasscheck show non-method ↵ | Randolf Scholz | 2023-11-24 | 1 | -1/+6 |
| | | | | | members (#112344) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-112194: Convert more examples to doctests in `typing.py` (#112195) | Nikita Sobolev | 2023-11-17 | 1 | -31/+43 |
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-112155: Run `typing.py` doctests as part of `test_typing` (#112156) | Nikita Sobolev | 2023-11-16 | 1 | -2/+2 |
| | |||||
* | GH-112152: Fix typo in `typing.override` docstring (#112158) | Qua27 | 2023-11-16 | 1 | -1/+1 |
| | |||||
* | gh-110682: Ignore `__match_args__` from `__instancecheck__` in protocols ↵ | Nikita Sobolev | 2023-10-12 | 1 | -1/+2 |
| | | | | | (#110683) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-110180: Remove unused `_PickleUsingNameMixin` class from `typing` (#110181) | Alex Waygood | 2023-10-01 | 1 | -7/+0 |
| | |||||
* | gh-109653: `typing.py`: improve import time by creating soft-deprecated ↵ | Alex Waygood | 2023-09-23 | 1 | -8/+18 |
| | | | | | members on demand (#109651) Co-authored-by: Thomas Grainger <tagrain@gmail.com> | ||||
* | gh-109543: Remove unnecessary hasattr check (#109544) | Jelle Zijlstra | 2023-09-20 | 1 | -2/+1 |
| | | | | Also added a new test case covering the scenario I thought this might be about. | ||||
* | gh-105509: Simplify implementation of `typing.Annotated` (#105510) | Alex Waygood | 2023-09-01 | 1 | -25/+13 |
| | |||||
* | gh-106309: Deprecate typing.no_type_check_decorator (#106312) | Alex Waygood | 2023-07-13 | 1 | -0/+2 |
| | |||||
* | gh-105974: Revert unintentional behaviour change for protocols with ↵ | Alex Waygood | 2023-06-23 | 1 | -32/+33 |
| | | | | non-callable members and custom `__subclasshook__` methods (#105976) | ||||
* | gh-105570: Deprecate unusual ways of creating empty TypedDicts (#105780) | Alex Waygood | 2023-06-14 | 1 | -2/+17 |
| | | | Deprecate two methods of creating typing.TypedDict classes with 0 fields using the functional syntax: `TD = TypedDict("TD")` and `TD = TypedDict("TD", None)`. Both will be disallowed in Python 3.15. To create a TypedDict class with 0 fields, either use `class TD(TypedDict): pass` or `TD = TypedDict("TD", {})`. | ||||
* | gh-105566: Deprecate unusual ways of creating `typing.NamedTuple` classes ↵ | Alex Waygood | 2023-06-14 | 1 | -3/+45 |
| | | | | | | | (#105609) Deprecate creating a typing.NamedTuple class using keyword arguments to denote the fields (`NT = NamedTuple("NT", x=int, y=str)`). This will be disallowed in Python 3.15. Use the class-based syntax or the functional syntax instead. Two methods of creating `NamedTuple` classes with 0 fields using the functional syntax are also deprecated, and will be disallowed in Python 3.15: `NT = NamedTuple("NT")` and `NT = NamedTuple("NT", None)`. To create a `NamedTuple` class with 0 fields, either use `class NT(NamedTuple): pass` or `NT = NamedTuple("NT", [])`. | ||||
* | gh-104873: Add typing.get_protocol_members and typing.is_protocol (#104878) | Jelle Zijlstra | 2023-06-14 | 1 | -0/+42 |
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | Miscellaneous improvements to the typing docs (#105529) | Alex Waygood | 2023-06-09 | 1 | -6/+6 |
| | | | Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative. | ||||
* | Further improve docs for `typing.Annotated` (#105498) | Alex Waygood | 2023-06-08 | 1 | -6/+8 |
| | |||||
* | typing: Improve documentation of generic classes and aliases (#105369) | Alex Waygood | 2023-06-07 | 1 | -3/+5 |
| | |||||
* | gh-105430: Remove `typing._Immutable` unused internal helper (#105434) | Nikita Sobolev | 2023-06-07 | 1 | -11/+0 |
| | |||||
* | gh-105286: Further improvements to `typing.py` docstrings (#105363) | Alex Waygood | 2023-06-07 | 1 | -25/+43 |
| | |||||
* | gh-105286: Improve `typing.py` docstrings (#105287) | Alex Waygood | 2023-06-05 | 1 | -217/+253 |
| | | | | Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me> | ||||
* | gh-105280: Ensure `isinstance([], collections.abc.Mapping)` always evaluates ↵ | Alex Waygood | 2023-06-05 | 1 | -8/+20 |
| | | | | to `False` (#105281) | ||||
* | gh-105237: Allow calling `issubclass(X, typing.Protocol)` again (#105239) | Alex Waygood | 2023-06-05 | 1 | -0/+4 |
| | |||||
* | gh-105144: Runtime-checkable protocols: move all 'sanity checks' to ↵ | Alex Waygood | 2023-05-31 | 1 | -19/+15 |
| | | | | `_ProtocolMeta.__subclasscheck__` (#105152) | ||||
* | gh-104943: Remove mentions of old Python versions (#104945) | Tomas R | 2023-05-26 | 1 | -4/+1 |
| | |||||
* | gh-104786: Remove kwargs-based TypedDict creation (#104891) | Tomas R | 2023-05-25 | 1 | -17/+2 |
| | | | | | Deprecated since Python 3.11. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-104935: typing: Fix interactions between `@runtime_checkable` and ↵ | Jelle Zijlstra | 2023-05-25 | 1 | -3/+3 |
| | | | | | | | `Generic` (#104939) --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-104797: Allow Protocols to inherit from collections.abc.Buffer (#104827) | Jelle Zijlstra | 2023-05-24 | 1 | -1/+1 |
| | |||||
* | gh-92871: Remove typing.{io,re} namespaces (#92873) | Sebastian Rittau | 2023-05-23 | 1 | -42/+1 |
| | | | | | | Closes #92871 Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||||
* | Improve readability of `typing._ProtocolMeta.__instancecheck__` (#104649) | Alex Waygood | 2023-05-19 | 1 | -13/+14 |
| | |||||
* | gh-74690: Don't set special protocol attributes on non-protocol subclasses ↵ | Alex Waygood | 2023-05-18 | 1 | -6/+7 |
| | | | | | of protocols (#104622) Don't set special protocol attributes on non-protocol subclasses of protocols | ||||
* | gh-104555: Runtime-checkable protocols: Don't let previous calls to ↵ | Alex Waygood | 2023-05-17 | 1 | -7/+13 |
| | | | | | `isinstance()` influence whether `issubclass()` raises an exception (#104559) Co-authored-by: Carl Meyer <carl@oddbird.net> | ||||
* | typing: Use PEP 695 syntax in typing.py (#104553) | Jelle Zijlstra | 2023-05-17 | 1 | -11/+17 |
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-104555: Fix isinstance() and issubclass() for runtime-checkable protocols ↵ | Alex Waygood | 2023-05-16 | 1 | -1/+1 |
| | | | | | that use PEP 695 (#104556) Fixes #104555 | ||||
* | gh-103763: Implement PEP 695 (#103764) | Jelle Zijlstra | 2023-05-16 | 1 | -421/+170 |
| | | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (#104424) | Alex Waygood | 2023-05-13 | 1 | -24/+3 |
| | |||||
* | gh-104415: Fix refleak tests for `typing.ByteString` deprecation (#104416) | Nikita Sobolev | 2023-05-12 | 1 | -0/+9 |
| | |||||
* | gh-91896: Improve visibility of `ByteString` deprecation warnings (#104294) | Alex Waygood | 2023-05-12 | 1 | -1/+31 |
| | |||||
* | gh-104392: Remove _paramspec_tvars from typing (#104393) | Jelle Zijlstra | 2023-05-11 | 1 | -13/+6 |
| | | | | This does nothing. | ||||
* | gh-104328: Fix typo in ``typing.Generic`` multiple inheritance error message ↵ | Kirill Podoprigora | 2023-05-09 | 1 | -1/+1 |
| | | | | (#104335) | ||||
* | Improve assert_type phrasing (#104081) | Shantanu | 2023-05-02 | 1 | -3/+4 |
| | | | | | | | | | I'd like to make the fact that this does nothing at runtime really obvious, since I suspect this is unintuitive for users who are unfamiliar with static type checking. I thought of this because of https://discuss.python.org/t/add-arg-check-type-to-types/26384 wherein I'm skeptical that the user really did want `assert_type`. | ||||
* | GH-103629: Update Unpack's repr in compliance with PEP 692 (#104048) | Franek Magiera | 2023-05-01 | 1 | -1/+12 |
| | |||||
* | GH-103699: Add `__orig_bases__` to various typing classes (#103698) | Adrian Garcia Badaracco | 2023-04-23 | 1 | -2/+9 |
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||||
* | gh-97797: Mention `__metadata__` in docstrings of `typing.{_AnnotatedAlias, ↵ | Nikita Sobolev | 2023-04-10 | 1 | -0/+6 |
| | | | | | | Annotated}` (#103405) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Kirill <80244920+Eclips4@users.noreply.github.com> | ||||
* | gh-74690: Further optimise `typing._ProtocolMeta.__instancecheck__` (#103280) | Alex Waygood | 2023-04-05 | 1 | -1/+1 |
| | |||||
* | gh-74690: typing: Call `_get_protocol_attrs` and `_callable_members_only` at ↵ | Alex Waygood | 2023-04-05 | 1 | -11/+14 |
| | | | | protocol class creation time, not during `isinstance()` checks (#103160) | ||||
* | gh-74690: typing: Simplify and optimise `_ProtocolMeta.__instancecheck__` ↵ | Alex Waygood | 2023-04-05 | 1 | -11/+3 |
| | | | | (#103159) | ||||
* | gh-102433: Use `inspect.getattr_static` in ↵ | Alex Waygood | 2023-04-02 | 1 | -5/+21 |
| | | | | `typing._ProtocolMeta.__instancecheck__` (#103034) | ||||
* | gh-74690: Micro-optimise `typing._get_protocol_attrs` (#103152) | Alex Waygood | 2023-03-31 | 1 | -8/+12 |
| | | | Improve performance of `isinstance()` checks against runtime-checkable protocols | ||||
* | gh-74690: typing: Don't unnecessarily call `_get_protocol_attrs` twice in ↵ | Alex Waygood | 2023-03-31 | 1 | -10/+21 |
| | | | | | `_ProtocolMeta.__instancecheck__` (#103141) Speed up `isinstance()` calls against runtime-checkable protocols | ||||
* | gh-88965: typing: fix type substitution of a list of types after initial ↵ | Nikita Sobolev | 2023-03-23 | 1 | -7/+26 |
| | | | | | | | | | | | | | | | | | | | `ParamSpec` substitution (#102808) Previously, this used to fail: ```py from typing import * T = TypeVar("T") P = ParamSpec("P") class X(Generic[P]): f: Callable[P, int] Y = X[[int, T]] Z = Y[str] ``` Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> |