Jelle Zijlstra
94ab32ba59
Fix abstract classes for Python 3 ( #2239 )
...
* add metaclass=ABCMeta to some classes
* mark some more classes as explicitly abstract
* make some more classes concrete
2018-06-16 10:18:54 -07:00
Jelle Zijlstra
82c930e66c
Improve asyncio.tasks stubs ( #2139 )
...
- Use PEP 526-style variable annotations where possible
- Use FrameType instead of Any
- Remove workaround for mypy issue that was since fixed
2018-06-11 14:40:54 -07:00
Jelle Zijlstra
cb293ebd2e
switch order of base classes on awaitable classes ( #2125 )
...
Fixes #1940 .
This makes it so that mypy will infer the common base class of these
classes to be Awaitable instead of Iterable. I verified that this
fixes the errors in the script posted by @neilconway.
2018-06-11 14:20:31 -07:00
Jelle Zijlstra
f789ee25ad
make EnumMeta instantiable ( #2118 )
...
part of #1476 . Verified that len(Enum) is still allowed by mypy.
2018-06-11 14:02:16 -07:00
Jelle Zijlstra
f73351f5bf
make tracemalloc.Traceback instantiable ( #2117 )
2018-06-11 14:01:46 -07:00
Ethan Smith
e9600db2ec
Remove symlinks! ( #2132 )
2018-05-15 15:18:59 -04:00
Tomas Krizek
db5137b756
stdlib/selectors: change timeout argument type to float ( #2070 )
...
The Selector's code internally uses select.select and passes the
timeout argument to it. The documentation explicitly states the
timeout is a floating point number:
https://docs.python.org/3/library/select.html?highlight=select#select.select
2018-04-19 08:36:53 -07:00
Eddie Schoute
5327841a18
Add pathlib.Path.__enter__ and __exit__ ( #2048 )
2018-04-12 10:39:19 -07:00
NODA, Kai
b472130201
Improve asyncio APIs which take TCP port ( #2006 )
...
They have getaddrinfo(3) as their backend, and accept port='http' etc. You can even omit (pass None to) either of host or port for start_server() to effectively select 'localhost' and an arbitrary ephemeral port, respectively.
2018-04-08 23:17:32 -07:00
Sergey Passichenko
00efd76861
Rename parameter to match the actual name in stdlib ( #1959 )
2018-03-10 09:10:09 -08:00
Rob Day
f91163d729
Fix type of loop parameter to start_unix_server ( #1939 )
2018-03-03 13:34:02 -08:00
NODA, Kai
3c4bc4266d
improve asyncio.AbstractEventLoop.getaddrinfo() ( #1867 )
...
The signature should match that of socket.getaddrinfo()
2018-02-14 16:09:38 +00:00
Rick Kilgore
1713ad64de
allow Optional[float] for asyncio.wait() timeout arg ( #1860 )
2018-02-07 19:49:33 -08:00
Nathan Henrie
9429ac070b
Use Union[bytes, Text] instead of AnyStr ( #1819 )
2018-01-11 08:23:39 -08:00
Elazar Gershuni
b41c6dafee
Make Enum Iterable (etc.) only structurally ( #1755 )
...
Can't express the precise type nominally - see mypy#3210 for details
* Make self generic in __contains__
2017-12-21 13:32:10 -08:00
Elazar Gershuni
97fb265a4c
Avoid over-constraining selftype of EnumMeta ( #1770 )
...
This is needed for python/mypy#4311 , and is sound.
2017-12-04 11:21:57 -08:00
Nathan Henrie
87fca814b1
addr should be Tuple[str, int], not str ( #1740 )
...
I think `addr` here should also be `Tuple[str, int]`, the same change made to `sendto` in [this pr merged a few months ago](0e26c1f936 (diff-d21efb8da2d73c6c7c769270b387cd47) ).
2017-11-12 23:14:16 -08:00
Jelle Zijlstra
54dd6ba27c
Change numerous default values to ... ( #1722 )
...
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Martin DeMello
817c270c32
Clean out the pytype blacklist ( #1667 )
2017-10-24 10:38:34 -07:00
FichteFoll
8b6234ad2c
Use self-type in asyncio.Future.*_done_callback ( #1614 )
2017-10-10 10:06:57 -07:00
Carl Meyer
a19d4e34c3
Add 3-argument overload for asyncio.gather. ( #1644 )
2017-10-03 11:41:25 -07:00
Bruce Merry
55dbb967ad
Corrections to the asyncio exception stubs ( #1623 )
...
Fixes #1622 :
- Missing attribute `LimitOverrunError.consumed`
- Missing attribute `IncompleteReadError.expected` and `.partial`
- `partial` argument to `IncompleteReadError` had incorrect type
- `expected` argument to `IncompleteReadError` missing `Optional`
2017-09-22 07:47:17 -07:00
FichteFoll
cc3e753202
All loop kwargs in asyncio.streams are optional ( #1615 )
...
I verified this with the module code. All these loop arguments default
to `None` and are set with `events.get_event_loop()` if this is the
case.
2017-09-18 07:51:25 -07:00
Elazar Gershuni
d4b21efbe8
Derive EnumMeta from ABCMeta ( #1598 )
...
Avoid inconsistent metaclass structure for enum mixins due to #1595 - e.g. mypy/#2824
2017-09-10 17:44:53 -07:00
Liran Nuna
c5f1e907fa
More precisely typehint asyncio.gather up to 5 params ( #1550 )
2017-08-28 21:37:51 -07:00
Ivan Levkivskyi
d75ea88da5
Use 'as name' patter to re-export names from stubs (PEP 484) ( #1484 )
2017-07-14 21:31:53 -07:00
Jelle Zijlstra
0e26c1f936
asyncio: fix several types ( #1450 )
...
Fixes #1447
2017-07-06 14:22:55 -07:00
Jelle Zijlstra
16aa0651ae
Revert "Add __new__ to str and int stubs in both Pythons. ( #1352 )" ( #1466 )
...
This reverts commit fed4e03e53 .
2017-07-06 14:21:54 -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
Semyon Proshev
fed4e03e53
Add __new__ to str and int stubs in both Pythons. ( #1352 )
...
* Update default values to `...` in `__init__` and `__new__` in `int` and `str`.
* Add `__new__` to `enum.IntEnum` to override inherited `__new__`.
* Add `type: ignore` comment to `IntEnum`
2017-06-12 20:53:32 -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
mistermocha
2053e5882f
Completing functionality for enum.auto ( #1331 )
...
Full context: https://github.com/python/mypy/pull/3441
Closes python/mypy#3434 .
2017-05-27 15:06:00 -07:00
Jelle Zijlstra
4f2dd0f446
remove unused type ignore flags ( #1346 )
...
Verified that none of those are necessary for pytype.
2017-05-26 08:28:51 -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
Jelle Zijlstra
d571f101ba
fixes to selectors stub ( #1304 )
...
Make type aliases private; add defaults
2017-05-22 23:12:02 -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
Jelle Zijlstra
e3f495b7e9
Add missing enum attributes ( #1195 )
...
Fixes #854 (unless there's more I'm missing).
2017-04-24 15:30:59 -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
Jelle Zijlstra
f7e4cb8c79
make enums support len() ( #1139 )
2017-04-05 08:22:28 -07:00
Guido van Rossum
f44e461d19
Use a separate type variable for unique() ( #1138 )
...
* Use a separate type variable for unique()
See https://github.com/python/typeshed/pull/1136#discussion_r109727053
* actually use the new typevar
2017-04-04 23:48:19 -07:00
Guido van Rossum
7027c3e4e8
Support enum iteration ( #1136 )
...
* Support enum iteration.
Fixes python/mypy#2305 .
* Make EnumMeta inherit from type, not ABCMeta.
2017-04-04 10:17:52 -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