Commit Graph

54 Commits

Author SHA1 Message Date
Nikita Sobolev
675ab38ab7 Update pyright version to 1.1.350 (#11501)
If you're reading about this commit in an auto-generated changelog: this is an internal change that should have no impact on how these stubs are understood by static-analysis tools such as type checkers or IDEs
2024-02-29 10:14:39 +00:00
Nikita Sobolev
e961db9492 Change the asyncio.Task constructor type (#10228) 2024-02-17 15:50:26 -08:00
Sebastian Rittau
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 Rittau
23604858a6 Remove Python 3.7 branches (#11238) 2024-01-05 11:39:39 +01:00
Alex Waygood
10febc4fe0 stdlib: remove unused type: ignore comments (#11061) 2023-11-23 14:00:07 +01:00
Alex Waygood
a08d4c8d2e Remove many redundant inheritances from Generic[] (#10933) 2023-10-26 20:07:20 +02:00
James Hilton-Balfe
25eb99cbec Add better types for asyncio.gather (#9678) 2023-10-04 10:10:41 +01:00
Alex Waygood
fecb84eb05 Update asyncio.tasks for py312 (#10669)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2023-09-06 12:35:48 +01:00
Kyle Altendorf
28d3ce2951 asyncio.wait() no longer allows awaitables in 3.11 (#10626)
https://docs.python.org/3.10/library/asyncio-task.html#asyncio.wait
> Run awaitable objects in the aws iterable concurrently and block until the condition specified by `return_when`.

https://docs.python.org/3.11/library/asyncio-task.html#asyncio.wait
> Run Future and Task instances in the aws iterable concurrently and block until the condition specified by `return_when`.
2023-08-29 10:56:44 +01:00
Dave Halter
40c639fcb0 The name param in asyncio.Task.__init__ is optional (#10615) 2023-08-25 13:42:53 -07:00
Nikita Sobolev
86218a52b7 Add get_context methods to asyncio in 3.12 (#10534) 2023-08-06 12:02:48 +01:00
Nikita Sobolev
81d1362247 Fix asyncio.Task.__init__ signature (#10532) 2023-08-04 15:12:51 +02:00
Nikita Sobolev
f7d7bb53ca Change asyncio.Task.__init__ signature for Python 3.12 (#10184) 2023-05-15 13:34:45 +02:00
Nikita Sobolev
1d8a199582 [asyncio] Make create_task work with coroutines only in 3.12 (#10177)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-14 12:16:26 +01:00
Alex Waygood
6ba28ae547 Remove unused type: ignore comments (#9801) 2023-02-23 12:59:50 -08:00
Alex Waygood
33a62ae42d Add more defaults to the stdlib (#9606)
Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Avasam
23ac9bff19 Check for unused pyright: ignore and differentiate from mypy ignores (#9397) 2022-12-28 10:44:29 +00:00
Marc Mueller
93075bf2fc Use general type ignore for asyncio.Task (#8861) 2022-10-07 02:51:14 +01:00
Sam Bull
493e35b15e Make asyncio.Task covariant (#8781) 2022-10-03 14:44:59 -07:00
Nikita Sobolev
a376da87bd Remove duplicate definitions (#8483) 2022-08-04 18:55:18 +02:00
Alex Waygood
1ebe1b463e Fix asyncio.gather regression (#8271)
Adding the empty-tuple overload caused major problems for pyright, and that overload only deals with an unlikely edge case anyway. Get rid of it, and replace the fallback overload with a more general overload.

Fixes #8270.
2022-07-16 18:56:58 +01:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood
8826d3a36f Rename some confusingly named type aliases (#8129) 2022-06-21 20:51:05 +01:00
Alex Waygood
0740d1c48e asyncio.gather: Add overload for if no positional arguments are provided (#8126) 2022-06-21 15:31:40 +01:00
Alex Waygood
cad42c7c7b asyncio.gather: Remove default values for return_exceptions: bool overloads (#8123) 2022-06-21 05:57:06 -07:00
Winston Chang
6653be1511 Add overloads for asyncio.sleep() (#7873)
Closes #7866. This adds an overload to `asyncio.sleep()`, so that when it is called _without_ `return=None`, the type checker knows that the return type is `None` instead of `unknown`.

Also related to https://github.com/microsoft/pyright/issues/3475.
2022-05-18 16:19:45 -07:00
Jelle Zijlstra
eab82c838a asyncio: updates for 3.11 (#7844)
CPython changes:

- 13c10bfb77
- 9523c0d84f
- 9f04ee569c
- d03acd7270
- 195a46d6ff

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-17 18:11:29 -07:00
Alex Waygood
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Guido van Rossum
47cccff9cb asyncio.Task: .cancelling() and .uncancel() now return int, not bool (#7405) 2022-02-28 17:35:42 -08:00
Alex Waygood
240628c4dd Add missing objects to plistlib, and improve __all__ in asyncio.tasks, http.server, & multiprocessing.__init__ (#7363) 2022-02-22 16:39:34 -08:00
Alex Waygood
d9e7673273 Add asyncio.tasks.__all__ (#7280) 2022-02-18 19:15:09 -08:00
Guido van Rossum
35bddd289f Add asyncio.taskgroups and new Task methods (#7240)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-17 00:32:20 +02:00
Nikita Sobolev
1b99812621 Require coroutines for create_task() (#6779) 2022-02-02 13:35:00 +01:00
Shantanu
b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Alex Waygood
4e046163b5 Delete many redundant method redefinitions (#6877) 2022-01-09 11:21:03 -08:00
Nikita Sobolev
a58a5bbed6 Use pos-only arguments in asyncio.gather (#6834) 2022-01-05 23:50:56 +02:00
Nikita Sobolev
bbd8c77b16 Use "async def" in asyncio/tasks.pyi (#6783) 2022-01-02 16:22:05 +01:00
Nikita Sobolev
03861b5a1d Use Literal type for constans in asyncio/tasks (#6781) 2022-01-02 12:42:00 +02:00
Alex Waygood
da8bab974a Add missing asyncio functions (#6418)
These were added in https://bugs.python.org/issue32250 and https://bugs.python.org/issue32415
2021-11-27 23:43:00 -08:00
Akuli
a5bc1e037f Add mypy error codes to '# type: ignore' comments (#6379) 2021-11-26 07:07:56 +01:00
Alex Waygood
029cf555e7 Use lowercase set/deque in stdlib subdirectories (#6350) 2021-11-20 04:20:25 -08:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Andrew Svetlov
c0030b2b12 Fix msg parameter type for asyncio Future.cancel() and Task.cancel() (#5999) 2021-09-03 09:07:20 -07:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
df6a211855 Use new union syntax in rest of stdlib (#5884) 2021-08-08 15:44:30 +02:00
Thomas Grainger
0a73982318 add asyncio.Task.get_coro return type (#5536) 2021-05-27 11:04:20 +02:00
Shantanu
26f3748741 asyncio.tasks: update for py310 (#5283)
Just removing the loop argument from various places
2021-05-01 20:29:58 -07:00