Commit Graph

29 Commits

Author SHA1 Message Date
Andrew Svetlov
c0030b2b12 Fix msg parameter type for asyncio Future.cancel() and Task.cancel() (#5999) 2021-09-03 09:07:20 -07:00
Akuli
8d5452e873 do not use mypy-specific syntax in '# type: ignore' comments (#5953) 2021-08-29 03:58:34 -07:00
Oleg Höfling
64f481189f drop ellipsis assignments from module vars, classvars and instance attrs (#5914)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-08-11 19:26:58 +02: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
Matt Vollrath
753cb4caba Override argument type of DatagramProtocol.connection_made() (#5873) 2021-08-08 11:16:26 +02:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Akuli
42247feefb use Self in async context managers (#5724) 2021-07-06 08:47:49 +02:00
Anton Grübel
8a107464a8 Use _typeshed.Self with __enter__ (#5719) 2021-07-01 23:15:13 +02:00
Dominic Davis-Foster
58559e56b3 Use _typeshed.Self where __enter__ returns self (#5698) 2021-06-27 22:58:58 +03:00
Sebastian Rittau
7e1b8384a0 Return concrete server from abstract event loop (#5566)
https://docs.python.org/3/library/asyncio-eventloop.html?highlight=abstracteventloop#creating-network-servers
documents the methods as returning a concrete server object.
2021-06-03 07:03:45 -07:00
Sebastian Rittau
6ee67483a3 Rework socket (#5545)
* Extract _socket.pyi from socket.pyi.
* Extract _socket.socket from socket.socket.
* Fix socket.family annotation.
* Annotate SocketIO properly.
* SocketType is an alias of _socket.socket.
* Sort items in socket.pyi in the same order as in socket.py.
* Remove socket.EINTR.
* Use _typeshed.WriteableBuffer instead of custom alias.
* Add errorTab (Windows only).
* Add _socket.dup().
* Mark positional-only argments.
* Remove constructors from socket exceptions.
* socket.timeout is an alias for TimeoutError, starting with Python 3.10.
* Use PEP 604 in changed lines.
* Add alias for fileno arguments.
* getaddrinfo() port can be bytes.
* Explicitly override some SSLSocket methods.
* Allow ReadableBuffer in _CMSG arguments.
2021-05-30 20:17:33 +02:00
Sebastian Rittau
ca256b85b9 asyncio.Server.socket fixes (#5538)
* Move socket from AbstractServer to Server.
* Fix Server.socket type on Python 3.7+.
* Use Iterable instead of list for socket argument.

Closes: #5535
2021-05-27 16:14:36 +02:00
Thomas Grainger
0a73982318 add asyncio.Task.get_coro return type (#5536) 2021-05-27 11:04:20 +02:00
Jelle Zijlstra
c4e3fd92cc Adjust types for asyncio.coroutines functions (#5517)
Noticed this in mypy-primer output in #5516 on this code: https://github.com/encode/starlette/blob/master/starlette/testclient.py#L74

It calls `iscoroutinefunction()` on an object that may be None, which got flagged as an error but is actually fine; it just returns False.

We could also potentially use TypeGuard here, especially for `iscoroutine` which is just an `isinstance` call.
2021-05-21 23:07:06 +02:00
Thomas Grainger
f1dd6cad52 name can be any object (#5494) 2021-05-19 11:03:07 +02:00
Sebastian Rittau
f0bf6eebbd AnyStr cleanup (#5487)
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.

Part of #5470
2021-05-17 20:45:48 +02:00
Sebastian Rittau
841a365284 Remove compatibility aliases (#5464)
* Remove compatibility aliases

Remove a few instances of Text

Use aliases from _typeshed

* Remove unused imports
2021-05-15 20:49:20 +03:00
Jelle Zijlstra
38dfb57adf Improve asyncio.subprocess stubs (#5327) 2021-05-02 21:50:29 -07:00
Shantanu
1826072dd1 asyncio.subprocess: remove loop in py310 (#5315) 2021-05-02 18:56:45 -07: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
Sebastian Rittau
4ac3ccad45 black: enable skip_magic_trailing_comma (#5252)
* black: enable skip_magic_trailing_comma

* Remove spurious commas
2021-04-27 08:32:32 -07:00
Thomas Cellerier
e5336e2358 loop.remove_signal_handler returns a bool (#5253) 2021-04-26 16:10:04 +02:00
Cássio Botaro
e2c4ffd9eb Tighten wait() return type using overloads (#5193)
Closes: #5095
2021-04-08 20:34:43 +02:00
Sebastian Rittau
190e07236f Tighten ensure_future() return type using overloads (#5190)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-04-08 17:31:45 +02:00
hatal175
88a8d0ccbc Explaining/Fixing asyncio allowlist exceptions (#5132) 2021-03-23 17:14:30 -07:00
Eric Traut
0ec182227c Added a few missing type arguments for generic types used in stdlib stubs
I just found and fixed a bug in pyright's "missing type arguments" check. When type arguments were omitted for a generic type within a subscript expression, the error was being suppressed. With this bug fixed, I found several new cases where type arguments were missing in stdlib stubs. (#5130)

Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-03-22 18:28:04 -07:00
Eric Traut
4b4ced5fa0 Added missing type annotations and type arguments (#5070)
Co-authored-by: Eric Traut <erictr@microsoft.com>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2021-02-25 15:09:58 -08:00
Ivan Levkivskyi
16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00