Jelle Zijlstra
0e26c1f936
asyncio: fix several types ( #1450 )
...
Fixes #1447
2017-07-06 14:22:55 -07:00
Guido van Rossum
350563223f
Add Optional[] for all remaining cases of x: <type> = None ( #1424 )
...
* Final round of adding Optional[] to type of arguments with default = None
* Update Travis to use --no-implicit-optionals and clarify CONTRIBUTING.md
2017-06-21 10:50:21 -07:00
Suren Nihalani
d494114214
asyncio.subprocess: fix type to include IO instead of just int and match Popen ( #1366 )
...
Fixes #1365
2017-05-28 18:58:23 -07:00
Sebastian Meßmer
e6af58a4cc
Fix type stubs in locks.pyi ( #1250 )
2017-05-25 19:32:17 -07:00
Sebastian Meßmer
3cfc146223
Fix type stubs in streams.pyi ( #1252 )
2017-05-23 23:14:41 -07:00
Jelle Zijlstra
6c5474ae8c
various fixes to asyncio stubs ( #1305 )
2017-05-23 16:14:29 -07:00
Jan Hermann
d68d0c5c00
fix asyncio.BaseEventLoop.create_task for >=3.5 ( #1272 )
...
* fix python/typeshed#1202 asyncio.BaseEventLoop.create_task for >=3.5
* remove unnecessary version distinction
2017-05-20 11:06:10 -07:00
Sebastian Meßmer
2ed9ee104f
Fix type stubs in transports.pyi ( #1255 )
2017-05-08 16:26:01 -07:00
Sebastian Meßmer
595e601882
Fix type stubs in events.pyi ( #1256 )
2017-05-08 16:24:25 -07:00
Sebastian Meßmer
9311e980f4
Fix type stubs in subprocess.pyi ( #1253 )
2017-05-08 16:24:02 -07:00
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