Commit Graph

121 Commits

Author SHA1 Message Date
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
Guido van Rossum
af2fadc180 More fixes related to PathLike (#1061)
* Make DirEntry generic over AnyStr, and inherit from PathLike if it exists

* Make pathlib require PathLike[str] (when it exists)
2017-03-21 22:26:21 -07:00
Jelle Zijlstra
25464cf0a7 Merge pull request #991 from JetBrains/sproshev/pep-519
Update `open`, `os.fspath`, `os.fsencode`, `os.fsdecode`, `pathlib.PurePath` and `pathlib.Path` stubs due to PEP-519
2017-03-21 07:38:50 -07:00
Jelle Zijlstra
53a42046cb Add tracemalloc (#1053)
* add stubs for tracemalloc

This one has especially nice documentation, even including type annotations.

* no PEP 526 so I can run tests locally

* fixes

* another one
2017-03-21 05:58:22 -07:00
Jelle Zijlstra
5898d75913 stub for statistics (#1021)
* stub for statistics

* fix missing imports

* drop int from the typevar
2017-03-18 14:41:42 -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
Semyon Proshev
e4fdd0eb62 Update stubs for pathlib.PurePath and pathlib.Path classes due to PEP-519. 2017-03-13 18:35:50 +03: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
984307bf45 fix odd version comparisons (#988)
"> (3,)" works but looks like the code is checking for Python 4.

"<= (3, 5)" was intended to check for versions up to and including 3.5, and probably works that
way in current type checkers. However, sys.version_info is actually a 5-tuple that is greater
than (3, 5), so a hypothetical type checker that uses the full version info would interpret
this check incorrectly.

This ensures that all version_info comparisons use <, >=, ==, or !=.
2017-03-12 20:48:48 -07:00