Commit Graph

47 Commits

Author SHA1 Message Date
Ivan Levkivskyi
05780a0d11 Fix errors discovered by running typeshed check on Windows (#3456)
Fix errors discovered by running typeshed check on Windows. This is a temporary fix for #3446 (in long term we should figure out why these were not caught by typeshed CI).

I also remove an outdated comment while I am at it.
2019-11-11 12:18:58 +00:00
Sebastian Rittau
e4677d9ed4 Use async syntax instead of @coroutine (#3441) 2019-11-06 07:39:09 -08:00
Jelle Zijlstra
cd5cd12a35 asyncio: fix windows stubs (#3424) 2019-10-30 08:13:32 -07:00
Sebastian Rittau
5e9f66cb62 Add missing Python 3.7 and 3.8 annotations (#3399)
* Add explicit ssl_handshake_timeout arguments to open_connection and start_server

* Add context arguments to call methods

* Accept PathLike for create_unix_* paths

* Add TimerHandle.when()

Add missing version check

* AbstractServer is now an async context manager

* Add happy_eyeballs_delay and interleave arguments to create_connection

* Re-export asyncio.windows_events from asyncio

* Add name argument to Task constructor

* Add Task.get_coro()

* import and other fixes

* Fix return type of get_coro()
2019-10-29 19:49:37 -07:00
Sebastian Rittau
87d7dd3d95 Fix annotations with literal values (#3411) 2019-10-28 06:59:28 -07:00
Rune Tynan
dfe68625ec Add public missing asyncio stubs for windows and proactor files (#3234)
* Add public missing asyncio stubs for windows and proactor files, and any necessary private return/argument types.

* Add methods to BaseProactorEventLoop that mypy is complaining about, with note about status at runtime

* Add asyncio constants file
2019-10-14 21:03:29 -07:00
Sebastian Rittau
0501e2b329 Annotations for remaining Python 3.8 additions (#3358)
* Add os.add_dll_directory()
* Add memfd_create() and flags
* Add type annotation to flags
* Add stat_result.st_reparse_tag and flags
* Add ncurses_version
* Add Path.link_to()
* Add Picker.reducer_override()
* Add plistlib.UID
* Add has_dualstack_ipv6() and create_server()
* Add shlex.join()
* Add SSL methods and fields
* Add Python 3.8 statistics functions and classes
* Remove obsolete sys.subversion
* Add sys.unraisablehook
* Add threading.excepthook
* Add get_native_id() and Thread.native_id
* Add Python 3.8 tkinter methods
* Add CLOCK_UPTIME_RAW
* Add SupportsIndex
* Add typing.get_origin() and get_args()
* Add unicodedata.is_normalized
* Add unittest.mock.AsyncMock

Currently this is just an alias for Any like Mock and MagicMock. All of
these classes should probably be sub-classing Any and add their own
methods. See also #3224.

* Add unittest cleanup methods
* Add IsolatedAsyncioTestCase
* Add ElementTree.canonicalize() and C14NWriterTarget
* cProfile.Profile can be used as a context manager
* Add asyncio task name handling
* mmap.flush() now always returns None
* Add posonlyargcount to CodeType
2019-10-14 09:53:48 +02:00
Sebastian Rittau
950f391704 Remove unnecessary __all__ annotations (#3357) 2019-10-13 16:22:03 -07:00
秋葉
2bd1b75641 Extract asyncio exceptions into a separate module (Python 3.8) (#3356) 2019-10-13 12:20:02 +02:00
Sebastian Rittau
256b3ce8ab Remove a bunch of unused imports (#3323) 2019-10-08 07:59:32 -07:00
Sebastian Rittau
c32e1e2280 Enable --disallow-any-generics for stubs (#3288) 2019-10-01 05:31:34 -07:00
Brad
412b9e74d5 Change last asyncio.gather() overload ret. to List (#3248)
Stems from PR #1550/ Issue #3243.
2019-09-30 12:42:58 +02:00
hh-h
1e881ad156 switched return_exceptions from bool to Literal for asyncio.gather (#3275) 2019-09-29 16:46:37 +02:00
Andrew Svetlov
60bdf60eda Add missing default for ssl_handshake_timeout agrument (#3277) 2019-09-29 15:13:09 +02:00
Scott Belden
04bcb89aea create_server returns a Server, not AbstractServer (#3131)
* remove create_unix_connection and use ABCMeta
2019-08-23 08:31:40 +02:00
Cole Maclean
29771aa1ee Add missing methods to asyncio stubs (#3088) 2019-08-06 08:34:38 +02:00
Nicklas Lindgren
3c4141982e Declare asyncio.as_completed() as taking an Iterable (#3164)
The stub for asyncio.as_completed declared it as taking a Sequence of
Futures. This was unnecessarily strict.

Just like asyncio.wait, asyncio.as_completed can be declared to take
an Iterable of Futures instead. Both these functions iterate over
their argument only once to store its items in a set, so an Iterable
is sufficiently strict. This has been true since the initial
implementation of the functions.
2019-07-31 10:53:23 -07:00
Sebastian Rittau
9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Jelle Zijlstra
b0c9fa4530 fix type of loop.sock_connect (#3073) 2019-06-21 17:31:51 +02:00
Walter Scott Johnson
901cb33a3c Mark asyncio loop parameters as Optional (#3047) 2019-06-10 20:58:31 +02:00
Mark Vismonte
a193aacea8 Add py3.7 support to Future.add_done_callback (#2970) 2019-05-07 13:14:03 -04:00
Anirudh Padmarao
53d4610579 Add stub for asyncio.BaseEventLoop (#2960) 2019-05-07 12:08:33 -04:00
Mark Vismonte
8451cd7819 Add annotation for Future._callbacks (#2965) 2019-05-07 18:02:41 +02:00
Mark Vismonte
e4a81132c4 Fix Future.__init__'s loop variable annotation (#2961) 2019-05-06 22:02:56 -04:00
Mark Vismonte
fe06e8e3c5 Add annotation to Future._loop (#2959) 2019-05-06 22:00:40 -04:00
Yegor Roganov
4cd9a8ef91 Make loop optional in asyncio.Queue (#2923)
Default value is `None`, so `loop` should be optional.
2019-04-14 12:43:33 -07:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
Jelle Zijlstra
832bf52c28 asyncio: make type alias private and CamelCase (#2849) 2019-03-11 08:43:00 +01:00
Chen Li
012901e318 [asyncio] Change _set_running_loop(loop: AbstractEventLoop) to _set_running_loop(loop: Optional[AbstractEventLoop]) (#2828) 2019-03-11 00:29:53 +01:00
Gleb Chipiga
6282e9f59f Update asyncio streams stub (#2845)
* Add is_closing and wait_closed methods to StreamWriter [Python 3.7]
* Update type of open_unix_connection and start_unix_server path parameter [Python 3.7]
2019-03-11 00:15:03 +01:00
Aymeric Augustin
af9082c302 Fix signature of asyncio.create_connection. (#2756)
* local_addr and server_hostname are optional and default to None.
* If sock is given, none of host, port, family, proto, flags and
  local_addr should be specified.
2019-02-23 10:04:15 -08:00
Aymeric Augustin
503cbb97a3 Fix signature of asyncio.create_server. (#2763)
* host may be None to bind to all interfaces.
* If sock is given, host and port shouldn't be specified.
2019-02-09 15:45:09 +01:00
Diogo Magalhães Martins
f4aed1fd40 Fixing type for asyncio.StreamWriter reader init parameter (#2719)
Closes #2718
2018-12-28 17:56:38 +01:00
Jelle Zijlstra
46ab77eb20 loop argument to asyncio.ensure_future is Optional (#2708)
The default value is None: https://github.com/python/cpython/blob/master/Lib/asyncio/tasks.py#L616.
2018-12-20 15:24:03 -08:00
Andrew Svetlov
b9be76c255 Task.current_task() and Task.all_tasks() have an optional loop parameter (#2690) 2018-12-12 13:18:18 -08:00
Sander Voerman
1b24d80087 Add get_loop() to asyncio.Future [Python 3.7] (#2680) 2018-12-09 21:37:37 +01:00
Summon528
9c45638650 Fix return annotation for asyncio.as_completed() (#2600) 2018-11-19 09:35:22 +01:00
Andrew Svetlov
07bc1c9997 Fix return annotation for loop.call_later() and loop.call_at() (#2559) 2018-10-26 14:15:32 +02:00
Sebastian Rittau
006a79220f Flake8 fixes (#2549)
* Fix over-indented continuation lines

* Fix under-indented continuation lines

* Fix whitespace around default operator problems

* Limit line lengths

* Fix inconsistent files
2018-10-24 07:20:53 -07:00
Andrew Svetlov
d43d8a2884 loop argument for set_event_loop() is optional, it can be None (#2525) 2018-10-18 14:24:54 +02:00
Sebastian Rittau
60548f122f AbstractEventLoop exception handler is optional (#2446)
Closes #1616

* get_exception_handler() is only available in 3.5
2018-09-11 08:26:57 -07:00
Zsolt Dollenstein
5ed39dd8ce bring protocols.pyi more inline with documentation (#2421) 2018-08-31 13:56:57 +02:00
Yusuke Miyazaki
9a01b817f7 Add sockets attribute to asyncio.events.AbstractServer (#2364) 2018-08-07 10:03:14 -07:00
Hynek Schlawack
7bdf4655e0 Add missing asyncio 3.7 top-level functions (#2320) 2018-07-20 08:10:52 -07:00
Linda_pp
0f8e0ad661 Add missing slow_callback_duration attribute to AbstractEventLoop (#2340) 2018-07-18 21:57:46 -07:00
Yusuke Miyazaki
5bb58af6c8 Use float instead of Union[int, float] (#2308) 2018-07-09 19:02:03 -07:00
Sebastian Rittau
2a36b4cf01 Move asyncio from 3.4 to 3 (#2307) 2018-07-03 09:06:04 -07:00