Commit Graph

60 Commits

Author SHA1 Message Date
Jeremy Apthorp
55dc338bbf Add stub for asyncio.wrap_future (#1183)
Closes #1182.
2017-04-21 07:53:14 -07:00
Sam Dunster
aaa83a7f12 Add missing attributes: asyncio.subprocess.Process (#1154)
Add typehints for the following `asyncio.subprocess.Process` attributes:

- `stdin`: `Optional[asyncio.streams.StreamWriter]`
- `stdout`: `Optional[asyncio.streams.StreamReader]`
- `stderr`: `Optional[asyncio.streams.StreamReader]`
- `pid`: `int`

Include stdin, stdout, and stderr also in SSP.
2017-04-11 15:14:37 -07:00
Roy Williams
90415f5f9d Add an alias for ensure_future as async (#1120)
`async` is still present in 3.6 and `ensure_future` doesn't exist before 3.4.4
2017-03-30 11:58:13 -07:00
Nathan Henrie
da43a231bb Add missing kwargs for create_server and create_datagram_endpoint (#1084)
* Add missing kwargs for create_server and create_datagram_endpoint

Looks like `create_server` and `create_datagram_endpoint` have supported `reuse_port`, `reuse_address`, and `sock` since 3.4.

https://docs.python.org/3.4/library/asyncio-eventloop.html
ee51327a23/Lib/asyncio/events.py

* Fixes to create_server, create_datagram_endpoing

- Add allow sequence for `hosts` in `create_server`
- Add `allow_broadcast` to `create_datagram_endpoint`
- Reorder `sock` in `create_datagram_endpoint`

* Import Sequence

* Sockets are Optionals
2017-03-29 10:31:44 -07:00
Jan Hermann
420219f057 fix derived queues in asyncio.queues to be generic python/typeshed#1087 (#1088) 2017-03-24 12:01:34 -07:00
Jelle Zijlstra
48b1962951 drop union return type from getaddrinfo (#1002) 2017-03-14 11:45:09 -07:00
Jelle Zijlstra
11350ed8cc Fix missing argument types in py3 stdlib (#995)
Still missing a few in _subprocess (a Windows-only private module) and decimal
(I gave up).
2017-03-14 11:43:42 -07:00
Jelle Zijlstra
eb07fd3c1a make sure typevars defined in stubs are private (#989)
And also a few type aliases I noticed in the process.

Found using 59f9cac095
2017-03-13 07:32:40 -07:00
Jelle Zijlstra
3e94c46e64 Add missing methods and @coroutine decorators to AbstractEventLoop (#958)
Closes #953.

I reviewed the documentation at https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.AbstractEventLoop and added missing methods and missing @coroutine decorators.

I ran mypy on the sample file from the issue report to confirm that mypy handles the combination of @abstractmethod and @coroutine correctly.

Also fixed a number of types in this file that are annotated as Any but could be given more precise types (e.g., sockets and protocol factories).
2017-03-12 20:21:25 -07:00
Jelle Zijlstra
06074e1e02 expose asyncio.open_unix_connection if it exists (#879)
Also fix the one other place where hasattr() is used (which PEP 484 doesn't support).
2017-02-06 11:41:11 -08:00
Tomasz Elendt
f9d6218ab7 Fix definitions of various AbstractEventLoop methods (#902) 2017-02-06 10:25:40 -08:00
Tomasz Elendt
b8df3de81a Coroutine functions should return Generator type (#903) 2017-01-31 14:28:07 -08:00
Guido van Rossum
0e9ad51882 Declare asyncio.wait() as taking an Iterable rather than a List. (#901) 2017-01-30 13:55:39 -08:00
Tomasz Elendt
a5e6ac4339 Fix ClientConnectedCallback in asyncio.stream (#900) 2017-01-30 13:53:33 -08:00
Matt Kimball
fd1201f5d5 Allow asyncio.wait to accept non-Task Futures (#881) 2017-01-29 17:53:38 -08:00
Jelle Zijlstra
66bc746bb3 StreamWriter.drain is a coroutine (#880)
See https://docs.python.org/3/library/asyncio-stream.html#asyncio.StreamWriter.drain
2017-01-29 11:33:35 -08:00
Jelle Zijlstra
9a1e8452a3 input argument to Process.communicate is Optional (#894)
The code for this method starts as follows:
```
    @coroutine
    def communicate(self, input=None):
        if input is not None:
            stdin = self._feed_stdin(input)
```
2017-01-29 10:12:36 -08:00
aostiles
0192f301b4 Reflect Python 3.4.4 asyncio.queues changes in stubs (#847)
Fixes #846
2017-01-19 16:11:09 -08:00
Jelle Zijlstra
511ff30f06 Make functions in asyncio.tasks accept Awaitables (#834) 2017-01-16 16:16:10 -08:00
Jason Fried
61cdd4b7ae AbstractEventLoop missing methods from 3.4.2 and up. (#798)
* Update asyncio/events.pyi for python 3.5.2
create_future, create_task, set_task_factory, get_task_factory
* Gate create_future to >= (3, 5)
2017-01-03 11:05:04 -08:00
Lukasz Langa
68a49c2c2e Fixing flake8 E111, E114, E116, E203, E225, E262 errors 2016-12-20 01:39:18 -08:00
Lukasz Langa
6eb97964fd Fixing flake8 E401, E402 errors 2016-12-20 00:47:51 -08:00
Lukasz Langa
147772950f Fixing flake8 E265 errors 2016-12-20 00:16:44 -08:00
Lukasz Langa
6b5c6626d6 Fixing flake8 E121, E122, E123, E124, E125, E126 errors 2016-12-19 23:53:19 -08:00
Lukasz Langa
67e38b6806 Fixing flake8 E231 errors 2016-12-19 23:53:19 -08:00
Lukasz Langa
fe0e3744cc Fixing flake8 E261 errors 2016-12-19 22:09:35 -08:00
Lukasz Langa
b84f20a011 Fixing flake8 W errors 2016-12-19 21:52:56 -08:00
TrueBrain
7e89fc0d49 Define __slots__ for object as Iterable[str] / Iterable[Union[str, unicode]] (#780)
* Define __slots__ for object as Iterable[str] / Iterable[Union[str, unicode]]
* A string as __slots__ value is also valid and represents a single item
2016-12-19 13:09:04 -08:00
Simon Ekstrand
aa6f4a07c1 Fix AbstractEventLoop.call* callable definitions. (#753)
Several asyncio AbstractEventLoop methods take a callback as
an argument that is passed *args. The Callable definition was
incorrect for those callbacks.
2016-12-16 15:15:20 -08:00
nobuggy
3f03849b70 Fix asyncio.wait for() and add exceptions (#676)
* asyncio.wait_for() should accept Awaitable[_T] same as asyncio.gather()

* {Cancelled,Timeout,InvalidState}Error types missing
2016-11-10 11:00:43 -08:00
Guido van Rossum
bf8b5ac5fd Relax signature of gather() (#677)
Fixes #675
2016-11-10 10:55:29 -08:00
Guido van Rossum
b476028df7 Fix signature of run_coroutine_threadsafe() (#657) 2016-11-04 14:49:49 -07:00
Guido van Rossum
7f7e2d4e75 Fixes for asyncio (#654)
* Fix signature of gather().  Also fold long lines and kill _GatheringFuture.

* Add several missing exports from tasks.
2016-11-04 11:19:22 -07:00
nobuggy
fa1eeb024e Two minor glitches in stdlib asyncio.Event.wait() / asyncio.wait_for() (#636)
* Event.wait() is a coroutine (https://docs.python.org/3/library/asyncio-sync.html#asyncio.Event)

* asyncio.wait_for accepts None as timeout (https://docs.python.org/3/library/asyncio-task.html)
2016-10-29 07:58:09 -07:00
claws
35cdafa10e add some missing asyncio items such as gather (#511)
* add some missing asyncio items

* sort items
2016-08-31 07:28:22 -07:00
Guido van Rossum
de4e87f574 Changes required by mypy async-await support (#435) 2016-08-03 17:01:35 -07:00
Guido van Rossum
39325bf159 Mypy now supports sys.platform and sys.version_info checks (#410) 2016-07-27 13:25:29 -07:00
Guido van Rossum
6d8628c247 Misc asyncio changes (#373)
* Add stub for cgi.parse_header().

* Improve asyncio stubs (far from complete)

* More asyncio changes.

* Use @overload to solve strange test failures.

* Add some TODOs. Make ProactorEventLoop conditional.

* Future should not inherit from Awaitable or implement __await__.

At least not yet.

* Fix AbstractServer.wait_closed() return type.

It's a generator, not a future.
2016-07-15 15:44:29 -07:00
tewe
c84c138194 Annotate **kwargs with dictionary value type only (#320) 2016-06-29 08:43:13 -07:00
Alvaro Caceres
d0ac66f5f8 Use "..." for attribute values, instead of None, [], {} 2016-06-15 14:10:04 -05:00
Guido van Rossum
54ba6d9b73 Fix typos: termina[ta]te(). 2016-03-09 09:21:15 -08:00
David Fisher
c50e0e6179 Remove contents of problematic asyncio __all__s 2016-02-25 11:59:25 -08:00
David Fisher
c48d66f28a Fix asyncio.coroutine signature 2016-02-24 11:35:42 -08:00
David Soria Parra
70ddf02d21 Use relative imports in asyncio.tasks and asyncio.futures 2016-02-19 19:52:54 -08:00
David Soria Parra
3223a693d5 Add type information for asyncio.subprocess 2016-02-19 19:52:36 -08:00
David Soria Parra
bce32b0382 Add type information for asyncio.streams 2016-02-19 19:52:36 -08:00
David Soria Parra
3910b79361 Add type information for asyncio.protocols 2016-02-10 23:12:31 -08:00
David Soria Parra
23ecee29d3 Add type information for asyncio.transports 2016-02-10 23:12:31 -08:00
David Soria Parra
0f5c38a2ce Add type information for asyncio.events.AbstractServer
Add the appropriate types for AbstractServer in asyncio.events. wait_closed() is
a couroutine, however in the implementation of AbstractServer not marked
as such. We are adding the couroutine defintion here anyway, as we do want
to make it typeable as a coroutine if necessary.
2016-02-10 22:09:22 -08:00
David Soria Parra
4d0a9e6d49 Add type information for asyncio.coroutines 2016-02-10 22:09:22 -08:00