Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | gh-108303: Move more `typing` related files to `Lib/test/typinganndata` ↵ | Nikita Sobolev | 2023-11-08 | 1 | -2/+1 |
| | | | | | (#111825) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-111808: Fix recursion error on WASM in `test_typing` (GH-111819) | Nikita Sobolev | 2023-11-07 | 1 | -5/+6 |
| | |||||
* | gh-111681: minor fixes to typing doctests; remove unused imports in ↵ | Nikita Sobolev | 2023-11-03 | 1 | -3/+2 |
| | | | | | `test_typing` (#111682) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in ↵ | Nikita Sobolev | 2023-10-20 | 1 | -4/+4 |
| | | | | `test_typing` (#111127) | ||||
* | gh-110782: Fix crash when TypeVar is constructed with keyword args (#110784) | Jelle Zijlstra | 2023-10-12 | 1 | -0/+6 |
| | |||||
* | gh-110682: Ignore `__match_args__` from `__instancecheck__` in protocols ↵ | Nikita Sobolev | 2023-10-12 | 1 | -0/+33 |
| | | | | | (#110683) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | Enable ruff on `Lib/test/test_typing.py` (#110179) | Alex Waygood | 2023-10-02 | 1 | -52/+52 |
| | |||||
* | gh-110178: Use fewer weakrefs in test_typing.py (#110194) | Jelle Zijlstra | 2023-10-02 | 1 | -1/+1 |
| | | | Confirmed that without the C changes from #108517, this test still segfaults with only 10 weakrefs. | ||||
* | gh-109653: `typing.py`: improve import time by creating soft-deprecated ↵ | Alex Waygood | 2023-09-23 | 1 | -0/+4 |
| | | | | | 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 | -0/+11 |
| | | | | 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 | -2/+1 |
| | |||||
* | gh-108295: Fix crashes with TypeVar weakrefs (#108517) | Jelle Zijlstra | 2023-08-27 | 1 | -0/+10 |
| | |||||
* | gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (#108354) | Nikita Sobolev | 2023-08-23 | 1 | -2/+4 |
| | |||||
* | gh-101162: Forbid using issubclass() with GenericAlias as the 1st arg ↵ | Nikita Sobolev | 2023-08-11 | 1 | -0/+16 |
| | | | | (GH-103369) | ||||
* | gh-106309: Deprecate typing.no_type_check_decorator (#106312) | Alex Waygood | 2023-07-13 | 1 | -4/+8 |
| | |||||
* | gh-105974: Revert unintentional behaviour change for protocols with ↵ | Alex Waygood | 2023-06-23 | 1 | -0/+40 |
| | | | | non-callable members and custom `__subclasshook__` methods (#105976) | ||||
* | gh-105834: Add tests for calling `issubclass()` between two protocols (#105835) | Alex Waygood | 2023-06-16 | 1 | -0/+74 |
| | | | Some parts of the implementation of `typing.Protocol` had poor test coverage | ||||
* | gh-105570: Deprecate unusual ways of creating empty TypedDicts (#105780) | Alex Waygood | 2023-06-14 | 1 | -0/+34 |
| | | | 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 | -9/+74 |
| | | | | | | | (#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 | -2/+67 |
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-105431: Remove unused stuff from `test_typing.NewTypeTests` (#105432) | Nikita Sobolev | 2023-06-08 | 1 | -7/+0 |
| | |||||
* | gh-103171: Forward-port new tests for runtime-checkable protocols dec orated ↵ | Alex Waygood | 2023-06-07 | 1 | -0/+65 |
| | | | | | with `@final` (#105473) Forward-port of the tests that were added to the 3.11 branch in #105445 | ||||
* | gh-105280: Ensure `isinstance([], collections.abc.Mapping)` always evaluates ↵ | Alex Waygood | 2023-06-05 | 1 | -0/+14 |
| | | | | to `False` (#105281) | ||||
* | gh-105237: Allow calling `issubclass(X, typing.Protocol)` again (#105239) | Alex Waygood | 2023-06-05 | 1 | -0/+59 |
| | |||||
* | gh-105144: Runtime-checkable protocols: move all 'sanity checks' to ↵ | Alex Waygood | 2023-05-31 | 1 | -18/+91 |
| | | | | `_ProtocolMeta.__subclasscheck__` (#105152) | ||||
* | Remove raw asserts in test_typing.py (#104951) | Jelle Zijlstra | 2023-05-26 | 1 | -22/+30 |
| | |||||
* | gh-104786: Remove kwargs-based TypedDict creation (#104891) | Tomas R | 2023-05-25 | 1 | -30/+3 |
| | | | | | 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 | -0/+42 |
| | | | | | | | `Generic` (#104939) --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-104879: Fix TypeAliasType.__module__ in exec() (#104881) | Jelle Zijlstra | 2023-05-24 | 1 | -0/+34 |
| | |||||
* | Improve test coverage for is_typeddict (#104884) | Jelle Zijlstra | 2023-05-24 | 1 | -3/+22 |
| | | | | | In particular, it's important to test that is_typeddict(TypedDict) returns False. | ||||
* | gh-104797: Allow Protocols to inherit from collections.abc.Buffer (#104827) | Jelle Zijlstra | 2023-05-24 | 1 | -0/+16 |
| | |||||
* | gh-92871: Remove typing.{io,re} namespaces (#92873) | Sebastian Rittau | 2023-05-23 | 1 | -23/+1 |
| | | | | | | Closes #92871 Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||||
* | gh-74690: Make a typing test more resilient (#104691) | Alex Waygood | 2023-05-21 | 1 | -4/+3 |
| | |||||
* | gh-104600: Make type.__type_params__ writable (#104634) | Jelle Zijlstra | 2023-05-19 | 1 | -0/+27 |
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> | ||||
* | gh-74690: Don't set special protocol attributes on non-protocol subclasses ↵ | Alex Waygood | 2023-05-18 | 1 | -0/+15 |
| | | | | | 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 | -0/+76 |
| | | | | | `isinstance()` influence whether `issubclass()` raises an exception (#104559) Co-authored-by: Carl Meyer <carl@oddbird.net> | ||||
* | typing: Add more tests for TypeVar (#104571) | Jelle Zijlstra | 2023-05-17 | 1 | -0/+42 |
| | | | | | | | | During the PEP 695 implementation at one point I made TypeVar.__name__ return garbage, and all of test_typing passed. So I decided to add a few more tests. In the process I discovered a minor incompatibility from the C implementation of TypeVar: empty constraints were returned as None instead of an empty tuple. | ||||
* | gh-104555: Fix isinstance() and issubclass() for runtime-checkable protocols ↵ | Alex Waygood | 2023-05-16 | 1 | -0/+18 |
| | | | | | that use PEP 695 (#104556) Fixes #104555 | ||||
* | gh-103763: Implement PEP 695 (#103764) | Jelle Zijlstra | 2023-05-16 | 1 | -35/+19 |
| | | | | | | | | | | | | | | 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 | -22/+6 |
| | |||||
* | gh-91896: Improve visibility of `ByteString` deprecation warnings (#104294) | Alex Waygood | 2023-05-12 | 1 | -4/+26 |
| | |||||
* | GH-103629: Update Unpack's repr in compliance with PEP 692 (#104048) | Franek Magiera | 2023-05-01 | 1 | -27/+32 |
| | |||||
* | gh-104036: Fix direct invocation of test_typing (#104037) | Kirill Podoprigora | 2023-05-01 | 1 | -1/+1 |
| | | | Previously, `python -m test test_typing` worked, but `python Lib/test/test_typing.py` did not. | ||||
* | gh-103746: Test `types.UnionType` and `Literal` types together (#103747) | Nikita Sobolev | 2023-04-24 | 1 | -0/+5 |
| | |||||
* | gh-103592: Add tests of `Literal` with `Enum` and `Union` of `Literal`s ↵ | Nikita Sobolev | 2023-04-23 | 1 | -0/+45 |
| | | | | (#103706) | ||||
* | GH-103699: Add `__orig_bases__` to various typing classes (#103698) | Adrian Garcia Badaracco | 2023-04-23 | 1 | -0/+59 |
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> | ||||
* | gh-103395: Improve `typing._GenericAlias.__dir__` coverage (#103396) | Nikita Sobolev | 2023-04-10 | 1 | -2/+61 |
| | |||||
* | gh-74690: Add more tests for runtime-checkable protocols (#103347) | Alex Waygood | 2023-04-07 | 1 | -2/+39 |
| | |||||
* | gh-102433: Use `inspect.getattr_static` in ↵ | Alex Waygood | 2023-04-02 | 1 | -2/+91 |
| | | | | `typing._ProtocolMeta.__instancecheck__` (#103034) | ||||
* | gh-103054: typing: Improve `Callable` type substitution tests (#103055) | Nikita Sobolev | 2023-03-29 | 1 | -0/+42 |
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com> |