Commit Graph
173 Commits
Author SHA1 Message Date
AvasamandGitHub 6d6e858e63 Enable Ruff PLC (Pylint Convention) (#13306) 2025-03-03 15:39:40 +01:00
ab75b691c2 Make collections.abcs more consistent with runtime implementation (#10816)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-12-27 21:31:59 -08:00
ShantanuandGitHub 5b17f78c32 typing: broaden type_check_only TypeVar bound (#13317)
This is needed if we do https://discuss.python.org/t/protocol-classes-should-not-match-callable-proto/75475
2024-12-27 19:56:08 -08:00
Stephen MortonandGitHub 3944c7839e Add __hash__ for a bunch of types that set it to None (#13286) 2024-12-23 23:16:22 -08:00
Stephen MortonandGitHub 17408ee538 fix the __init__ of several C-classes (#13211) 2024-12-23 10:55:51 -08:00
Brian SchubertandGitHub 318cebb776 Mark typing.TYPE_CHECKING as Final (#13180) 2024-12-03 22:23:19 +01:00
693add9512 Update return type of Generator.close in 3.13 (#13127)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-11-26 13:32:07 -08:00
Stephen MortonandGitHub 982fb8358b __reversed__ on dict views (#13073)
KeysView doesn't have __reversed__, but dict_keys does. When this
was added to typeshed, we didn't have dict_keys as a separate type.
2024-11-23 05:09:37 -08:00
Rebecca ChenandGitHub 921c65304e Annotate TypedDict as _SpecialForm rather than object. (#12985)
* Annotate TypedDict as _SpecialForm rather than object.

Let's see if this works...

* Get typing_extensions.TypedDict as well, try to fix tests.

* Import typing_extensions.TypedDict, delete _SpecialForm.__getitem__.

* Back out deletion of _SpecialForm.__getitem__.
2024-11-19 22:50:42 -08:00
Stephen MortonandGitHub 7c7629d909 add typing._Final (#13015)
This is the subset of typing module internal base classes
that are stable over all supported versions of python.
2024-11-16 16:55:38 +01:00
Stephen MortonandGitHub e8c2e5bb20 remove redundant inheritance from Iterator for typing.IO (#12870) 2024-10-22 01:29:03 +01:00
Stephen MortonandGitHub b62579b0d2 swap inheritance order for typing.Sequence (#12869)
This matches the order at runtime.
2024-10-21 22:37:02 +01:00
VictorienandGitHub db265afec5 Use Mapping for local Python namespace parameters (#12705) 2024-09-30 11:26:41 +02:00
Martin HuschenbettandGitHub 46512118ea Return coroutine from AsyncGenerator.__anext__ (#12685)
The `__anext__` method of an asynchronous generator defined using the
`async def`/`yield` syntax returns an actual coroutine not just any
awaitable. Let the definition of the `AsyncGenerator` protocol reflect
this circumstance.

See https://discuss.python.org/t/types-for-asynchronous-generators-too-general/64515
for the motivation behind this change.
2024-09-23 11:34:56 +02:00
AvasamandGitHub 3719f02dbf Using precise code for pyright: ignore and re-enabling various pyright tests (#12576) 2024-08-22 03:34:52 +02:00
Sebastian RittauandGitHub 7f38b116a0 Remove redundant overloads from IO (#12570) 2024-08-21 15:55:22 +02:00
Max MuotoandGitHub 8a7f09e351 Byestring removal for 3.14 (#12490) 2024-08-06 07:16:49 -07:00
Jelle ZijlstraandGitHub d482d4e83c More precise type for TypeAliasType.__getitem__ (#12354)
At runtime, this always returns a GenericAlias; see typealias_subscript
in Objects/typevarobject.c. See microsoft/pyright#8444.
2024-07-17 06:37:31 -07:00
Kumar AdityaandGitHub 98cf9a23eb Fix stubs for async generator methods (#12232) 2024-07-03 20:18:28 -07:00
Alex WaygoodandGitHub 3ab03deec3 Upgrade to latest 3.12 and 3.13 versions for stubtest (#12131) 2024-06-12 05:16:39 -06:00
Alex WaygoodandGitHub 2985ef414c typing(_extensions) updates for py313 (#12030) 2024-05-24 15:16:15 -04:00
ShantanuandGitHub 54b39e1de4 Add __replace__ to namedtuple and structseq (#11939)
mypy will need its own change to truly understand namedtuple
2024-05-18 05:55:09 -04:00
Alex WaygoodandGitHub 240114ac1a More PEP-696 updates to typing(_extensions) stubs (#11925) 2024-05-16 22:05:45 -04:00
Alex WaygoodandGitHub 5b0816e784 Fix stdlib stubtest after latest typing-extensions release (#11923) 2024-05-16 16:53:19 -04:00
Max MuotoandGitHub 3195f9fb1b Use TypeVar defaults for Generator and AsyncGenerator (#11867) 2024-05-13 15:21:43 -07:00
David SalvisbergandGitHub ea61ca5a30 [3.13] typing.(Async)ContextManager adds second type parameter (#11873)
This is in response to: https://github.com/python/cpython/pull/118681
2024-05-09 19:25:49 -07:00
Kaleb BarrettandGitHub 9ca0b20529 Make Awaitable.__await__'s result type's send arg Any (#11788) 2024-04-25 07:09:33 -07:00
David SalvisbergandGitHub f274c78fe5 Make ExitStack, AbstractContextManager and AsyncAbstractContextManager generic in return type of __exit__ (#11048) 2024-04-22 16:43:08 +02:00
Kaleb BarrettandGitHub ff946a7349 Update Coroutine.cr_frame to return correct type (#11798)
Update Coroutine.cr_frame to return correct type
2024-04-20 12:51:36 -07:00
AvasamandGitHub 12b9e48324 Update Ruff and enable F821 in stubs (#11771) 2024-04-17 09:50:58 -07:00
bzoraclerandGitHub bc4b26fbcb Allow NewType.__supertype__ to also be a NewType (#11728) 2024-04-07 06:15:51 -04:00
630b49a291 Replace various Incompletes in stdlib (#11673)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-01 15:20:01 +01:00
Sebastian RittauandGitHub 027115e624 Remove bare incompletes (#11670) 2024-03-30 18:35:57 -07:00
Jelle ZijlstraandGitHub a6bdb25991 typing: Deprecate creating a NamedTuple with kwargs (#11567)
https://github.com/python/cpython/blob/c5fa796619a8cae5a1a8a4a043d05a99adec713d/Lib/typing.py#L2874
2024-03-10 16:20:35 -07:00
1a942aa36d Replace Flake8 checks with Ruff (except for flake8-pyi) (#11496)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-03-10 14:35:45 +00:00
ShantanuandGitHub 470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Alex WaygoodandGitHub c49c84f319 A new shade of Black (#11362) 2024-02-04 16:38:55 -08:00
53a8193d64 Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2024-01-05 08:15:19 -08:00
Sebastian RittauandGitHub 23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
ViicosandGitHub 54447f63a4 Use type instead of Type in typing.pyi (#11235) 2024-01-04 05:04:43 -08:00
Alex WaygoodandGitHub 0b36e65877 Remove redundant sys.version_info condition (#11087)
We're already inside an `if sys.version_info >= (3, 12)` block here; no need to check if `sys.version_info >= (3, 10)`
2023-11-29 19:10:48 +00:00
Alex WaygoodandGitHub ef346aba0d Fixes to typing and typing_extensions stubs (#11086) 2023-11-29 19:00:58 +00:00
Alex WaygoodandGitHub 8023ba764a Remove redundant inheritances from Generic and various typing protocols (#10981) 2023-11-06 14:00:25 +01:00
Alex WaygoodandGitHub a08d4c8d2e Remove many redundant inheritances from Generic[] (#10933) 2023-10-26 20:07:20 +02:00
Jelle ZijlstraandGitHub 31495e53bd typing.pyi: IO.name may be bytes (#10738) 2023-09-20 08:24:22 +02:00
Alex WaygoodandGitHub 433204fb8f py312: Fix stubtest nits in typing/typing_extensions (#10659) 2023-09-04 15:39:11 +01:00
Alex WaygoodandGitHub df08fcec5f Improve __(r)or__ signatures for TypedDict classes (#10565) 2023-08-12 18:27:35 +01:00
e86c61da86 More precise overloads for get/pop methods (#10501)
Fixes #10293

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-07-26 16:37:32 +01:00
Jelle ZijlstraandGitHub f577c4c133 Update typing_extensions for 4.7.* (#10344) 2023-07-22 12:51:22 +01:00
Alex WaygoodandGitHub 03b4bb9cce Stdlib: add many missing __hash__ and __eq__ methods (#10464) 2023-07-17 14:21:02 +02:00