Commit Graph

64 Commits

Author SHA1 Message Date
Stephen Morton
f83b6fadbe add _asyncio (#12766)
improves naming and inheritance for asyncio.Future and asyncio.Task

related to https://github.com/python/typeshed/issues/3968
2024-10-09 20:55:28 -07:00
Max Muoto
670ca3125b Resolve asyncio issues for 3.13 (#12327) 2024-07-13 10:12:15 +02:00
Kumar Aditya
23c489642d remove child watchers from asyncio (#12189)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-06-23 15:09:45 +01:00
Jelle Zijlstra
eeea0ac614 asyncio: fix task factory types (#11993) 2024-05-21 11:18:38 +02:00
Shantanu
470a13ab09 Use PEP 570 syntax in stdlib (#11250) 2024-03-09 14:50:16 -08:00
Jelle Zijlstra
bba8cbd6f8 stdlib: more deprecations (#11009)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-18 06:50:29 -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
a08d2d5d66 Use PEP-646 in stubs for asyncio (#11015) 2023-12-08 22:59:42 +00:00
Jelle Zijlstra
c2c8d7cf5d stdlib: Apply some simple deprecations (#11044) 2023-11-23 09:03:01 +01:00
Alex Waygood
516f665505 Bump flake8-pyi to 23.11.0 (#10997) 2023-11-08 16:01:24 +00:00
Nikita Sobolev
86218a52b7 Add get_context methods to asyncio in 3.12 (#10534) 2023-08-06 12:02:48 +01:00
Alex Waygood
81b8211d0e Revert "Remove un-needed __hash__ methods from stdlib (#8465)" (#10426)
Reverts https://github.com/python/typeshed/pull/8465
Fixes https://github.com/python/typeshed/issues/10424
Closes https://github.com/python/typeshed/pull/10425

https://github.com/python/typeshed/pull/8465 caused regressions: see https://github.com/python/typeshed/issues/10424 and https://github.com/python/mypy/issues/13800. Since it didn't fix any known problems (just some stylistic nits that we had), let's just revert the PR.
2023-07-09 08:43:32 -07:00
Sam Bull
0869b430d6 asyncio: start_tls() can return None (#10346) 2023-06-28 11:40:19 +01:00
Nikita Sobolev
b25a5b6aef Use _AwaitableLike in EventLoop.run_until_complete (#10181) 2023-05-15 09:34:50 +01: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
Victor Westerhuis
6a242fd1ee Fix return types for asyncio recvfrom, recvfrom_into, and sendto (#10000)
Closes #9999
2023-04-03 11:58:12 +02:00
Alex Waygood
9ed39d8796 Use typing_extensions.Self in the stdlib (#9694) 2023-02-09 09:12:13 +00:00
Alex Waygood
53747b264e Stdlib: add 'obvious' default values (#9688) 2023-02-07 13:00:40 +01: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
gandalf3
b11e2e37c6 create_datagram_endpoint expects a str when family=AF_UNIX (#9574)
Since python 3.7, asyncio.loop.create_datagram_endpoint expects the
arguments `local_addr` and `remote_addr` to be `str` or `None` when the
argument family=`socket.AF_UNIX` and the argument `sock` is `None` or
also a unix socket.
2023-01-21 22:00:44 +01:00
Jelle Zijlstra
aa4d6d87ae asyncio: fix default for subprocess_exec (#9561) 2023-01-18 15:03:22 +01:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Avasam
c70d303985 Audit stdlib object annotations (#9519) 2023-01-17 15:40:00 +00:00
Bruce Merry
de12b1413d Refine types for asyncio transports (#9209)
- Change the return type of create_connection, start_tls,
  connect_accepted_socket, create_unix_connection to Transport
  rather than BaseTransport (closes #9199).
- Change the return type of create_datagram_endpoint to
  DatagramTransport rather than BaseTransport.
- Change the argument of sendfile to WriteTransport rather than
  BaseTransport.

I considered also changing the argument of start_tls to Transport, but
I think that will give false positives for code that implements a custom
transport class that inherits from both ReadTransport and WriteTransport
but not from Transport, and I'm not sure if typing has a way to express
an intersection of types. Since users are not normally expected to
implement transports that may be overthinking things.
2022-11-16 07:00:38 -08:00
Jelle Zijlstra
583b600db0 asyncio: improve bytes handling (#9013) 2022-10-29 00:36:44 +02:00
Nikita Sobolev
64bc0590a6 Remove un-needed __hash__ methods from stdlib (#8465) 2022-08-06 14:55:27 +01:00
Nikita Sobolev
a03e8b4949 Revert __eq__ removal (#8487)
Refs #8483
2022-08-04 23:51:42 +02:00
Nikita Sobolev
a376da87bd Remove duplicate definitions (#8483) 2022-08-04 18:55:18 +02:00
Sam Bull
be0d159df3 asyncio.AbstractEventLoop: Allow Path for create_unix_server() (#8376) 2022-07-24 15:43:52 +01:00
Alex Waygood
4b504c78e0 Improve asyncio callbacks (#8192) 2022-07-18 19:46:38 -07:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Chris Cotter
f7ff6239ff asyncio task factory can accept Coroutines too (#8205)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-03 18:00:29 +01: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
da3e69d093 stdlib: Improve a bunch of __(a)exit__ methods (#7571) 2022-04-01 08:05:25 +02:00
Alex Grönholm
3a8d121890 Fix type of the "host" parameter in asyncio getaddrinfo() (#7517) 2022-03-20 13:17:55 +00:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Alex Waygood
b228c8d29e Add asyncio.events.__all__ (#7266) 2022-02-18 17:50:28 -08:00
Alex Waygood
fbc279e3f5 stdlib: Add many missing dunder overrides (#7231) 2022-02-16 06:25:47 -08:00
Alex Waygood
66a229b709 stdlib: Add several missing comparison methods (#7202) 2022-02-14 11:09:52 -08:00
Alex Waygood
63489c305d asyncio: make AbstractServer abstract and remove unnecessary metaclass=ABCMeta (#7185) 2022-02-13 23:34:19 +02:00
Sebastian Rittau
92685d18f7 Update to Python 3.9.10 and 3.10.2 (#6977) 2022-02-11 17:37:31 -08: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
Andrew Svetlov
98afaa4c76 Fix loop.remove_reader() and loop.remove_writer() return types (#7042) 2022-01-26 14:52:15 +01:00
Vlad Starostin
fab2a47f9b Use stricter transport types in asyncio subprocess methods (#7026)
Co-authored-by: Vlad Starostin <vladstar@yandex-team.ru>
2022-01-25 11:07:36 +01:00
Vlad Starostin
e558fedf76 Use more precise return types in asyncio methods (#6937) 2022-01-17 19:56:48 +02:00
Alex Waygood
4e046163b5 Delete many redundant method redefinitions (#6877) 2022-01-09 11:21:03 -08:00