Commit Graph

716 Commits

Author SHA1 Message Date
Jelle Zijlstra
22f47fd478 add typing.AsyncContextManager and contextlib.asynccontextmanager (#1432)
Implements:
- https://github.com/python/typing/pull/438
- https://github.com/python/cpython/pull/360

Note that https://github.com/python/cpython/pull/1412, which adds
contextlib.AbstractAsyncContextManager, has not yet been merged.
2017-06-27 10:39:40 -07:00
mistermocha
5306d6f5a7 Correct implementation of standard types besides "object" (#1340)
Per https://github.com/python/mypy/issues/2989
2017-06-23 09:45:48 -07:00
Jelle Zijlstra
4a5ff0bb11 use PEP 526-style annotations in os stubs (#1428)
And fix some TODOs.

This will help me check these stubs with my stubcheck tool, and is better
for consistency anyway.
2017-06-22 05:49:23 -07:00
Antoine Reversat
6fe68fd120 [subprocess.run] Make timeout and input optional (#1426) 2017-06-21 13:28:16 -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
Guido van Rossum
30256097ea Use explicit Optional[] on argument types with default None (#1420) 2017-06-20 16:20:13 -07:00
Ask Solem
5e74bb3efc Stub for typing.AsyncIterable should have __aiter__, not __anext__ (#1396) (#1419)
Fixes #1396.
2017-06-20 14:23:56 -07:00
Luka Sterbic
4a8a20f04e Allow passing lambdas as init arguments in multiprocessing (#1416)
* Use NoReturn in multiprocessing init functions
* Use Any for init functions
2017-06-19 06:45:57 -07:00
Miguel Gaiowski
a8dea5e05c Update types for ThreadPoolExecutor for py3.6 (#1414)
* Update types for ThreadPoolExecutor for py3.6

* Removed Optional from ThreadPoolExecutor thread_name_prefix argument
2017-06-16 17:06:22 -07:00
Yusuke Miyazaki
1c8498228d Update stub for csv (#1398) 2017-06-15 16:35:17 -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
Matthias Kramm
ed6dc176da make itertools.product more precise (#1393) 2017-06-12 20:10:08 -07:00
Jan Hermann
0709985d0c fix signatures of sqlite3.register_adapter/converter (#1390) 2017-06-06 18:09:08 -07:00
rchen152
16ec7cbdf0 Add __new__ to time.struct_time (#1394)
This is needed because otherwise pytype uses the `__new__` inherited from the `NamedTuple` base class.
2017-06-06 15:36:01 -07:00
Luka Sterbic
0679e0232c Add start, shutdown and context manager methods to BaseManager (#1392) 2017-06-05 14:58:52 -07:00
Carl Meyer
802f3b21b3 Fix __init__ signature for unittest.mock.MagicMock. (#1388) 2017-06-04 10:08:56 -07:00
Lukasz Langa
0b1f5db630 Remove spurious whitespace 2017-06-02 12:53:38 -07:00
amstree
66765c1fdb add glob1 glob0 to glob (#1368)
* add glob1 glob0 to glob

* add glob1 glob0 to python 3 stub

* fix types to take str and unicode

* Update glob.pyi
2017-06-02 11:22:07 -07:00
Carl Meyer
6d88431403 Correct the type of MethodType.__func__. (#1383)
See python/mypy#3484 for background.
2017-06-02 11:06:07 -07:00
Cooper Lees
4656153478 Allow subprocess stdout + stderr be Optional (#1375)
- Adding optional to _FILE for stderr + stdout arguments to subprocess functions
- Sometimes you might want subprocess commands to be quiet and other time print the output
2017-06-01 17:46:14 -07:00
Yusuke Miyazaki
35852bd687 Update stub for grp (#1373) 2017-06-01 17:36:32 -07:00
Yusuke Miyazaki
193e6885d4 Update stub for spwd (#1372)
Update stub for spwd

- Use `NamedTuple`
- Fix stub for Python 3
  - Some attributes are changed from Python 2
    - `sp_nam` -> `sp_namp`
    - `sp_pwd` -> `sp_pwdp`
2017-05-31 12:07:21 -07:00
Semyon Proshev
5db571a8f3 Update typing.MutableMapping.update stubs to allow keyword-only arguments (#1370) 2017-05-30 21:44:10 -07:00
Yusuke Miyazaki
40c6927cf0 Update stub for pwd (#1371) 2017-05-30 21:43:30 -07:00
DmitriyS
9f433a57f4 Fix type stubs in typing.pyi (#1263) 2017-05-28 13:13:20 -07:00
Semyon Proshev
f9872cafd8 Update collections and typing.NamedTuple (#1276)
* Update stubs for `collections` module in both Pythons.
* Update `typing.NamedTuple` stub to have `_source` attribute.
* Fix compatibility of `deque.index` signature with supertype `Sequence`
2017-05-27 15:01:40 -07:00
Jelle Zijlstra
d23fe74072 add some exception classes to shutil (#1334) 2017-05-26 09:30:20 -07:00
Matthias Kramm
ac0b809bf5 tweak files to fix pytype parsing errors (#1325)
* Don't use "\" to join lines
2017-05-26 08:45:52 -07:00
Jelle Zijlstra
e8013fd808 add types.AsyncGeneratorType (#1322) 2017-05-26 08:37:39 -07:00
Jelle Zijlstra
fefdf185c7 merge and complete linecache stubs (#1320) 2017-05-26 08:30:42 -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
Jelle Zijlstra
c4e6ce319f minor fixes to email stubs (#1357) 2017-05-25 19:36:48 -07:00
Jelle Zijlstra
72a745b2f8 remove collections.MutableString (#1356)
It does not exist (some StackOverflow question I found suggests it was removed in 2.6).
2017-05-25 19:36:08 -07:00
Jelle Zijlstra
fce4424c6e add http.client.error (#1355)
It's in __all__
2017-05-25 19:35:36 -07:00
Jelle Zijlstra
a25b449ee0 add some missing classes and platform checks to socketserver (#1354)
These checks were already in SocketServer.pyi for Python 2.
2017-05-25 19:34:27 -07:00
Jelle Zijlstra
26d1ff8352 add tempfile.TMP_MAX for py3 (#1353) 2017-05-25 19:33:05 -07:00
Semyon Proshev
1ebcc1d11f Add timespec parameter to datetime.datetime.isoformat for Python 3.6+. (#1349) 2017-05-25 07:33:50 -07:00
Jelle Zijlstra
875b02e374 complete and merge weakref stubs (#1343) 2017-05-24 20:35:16 -07:00
elmar bucher
579f25896b fix posix and win32 specific realpath path.pyi definition (PR 2) (#1345)
Fixes #1335.
2017-05-24 18:54:50 -07:00
elmar bucher
fc76215cc5 add from importlib import util (#1341) 2017-05-24 16:20:18 -07:00
Jelle Zijlstra
d9bf214203 merge pickle stubs into 2and3 (#1328)
Followup from #1321
2017-05-24 14:57:58 -07:00
Jelle Zijlstra
6fe7cdb1c3 merge 2and3 stubs for select (#1333)
There don't seem to be significant changes between Python 2 and 3. The Python 2
stub was much better, so I mostly built off of it.
2017-05-24 14:57:11 -07:00
Jelle Zijlstra
6152bad0af add random.choices for 3.6 (#1329) 2017-05-24 14:09:52 -07:00
Jelle Zijlstra
89f27742ca add re.template (#1330) 2017-05-24 14:07:31 -07:00
Jelle Zijlstra
890190d349 add opcodes to pickle stubs (#1321) 2017-05-24 08:05:55 -07:00
Jelle Zijlstra
5e4165493a fix typo in importlib.abc (#1323) 2017-05-24 08:00:12 -07:00
Jelle Zijlstra
c930e889ee merge 2 and 3 stubs for fileinput (#1319)
* merge 2 and 3 stubs for fileinput

Plus some minor fixes.

* pytype doesn't like generic type aliases
2017-05-24 07:58:56 -07:00
Jelle Zijlstra
4ea798b869 inspect.getmoduleinfo was removed in 3.6 (#1318)
Compare https://docs.python.org/3.5/library/inspect.html#inspect.getmoduleinfo
and https://docs.python.org/3.6/library/inspect.html
2017-05-23 16:52:16 -07:00
Jelle Zijlstra
cca81d864a complete doctest stub (#1315)
* complete doctest stub

And merge it into 2and3 (the old stubs were virtually empty).

* note things changed in 3.4

2.7 also had an undocumented and deprecated doctest.Tester class. I'm going to leave it out until somebody asks for it to be added.
2017-05-23 16:34:34 -07:00
Luka Sterbic
9601a76b54 Use AsyncResult from multiprocessing.pool (#1317) 2017-05-23 16:33:46 -07:00