Commit Graph

1545 Commits

Author SHA1 Message Date
Guido van Rossum
ab0de25949 Bump typed-ast version to 1.0.4 (#1408) 2017-06-14 10:43:28 -07:00
Matthias Kramm
d5e7663f93 add back 'repeat' argument to itertools.product (#1407)
Fixes a regression introduced by #1393.
2017-06-14 09:33:37 -07:00
Matthias Kramm
6849262df6 add _levelNames to logging/__init__.py (#1404)
* add _levelNames to logging/__init__.py

* add Python 3's _levelToName and _nameToLevel
2017-06-13 08:26:14 -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
Ethan Smith
ac36193550 Add Gitter chat badge (#1399)
And update other gitter links.
2017-06-12 15:55:05 -07:00
Matthias Kramm
d4c13e73f9 gzip.GzipFile.__init__ accepts any Text for 'mode' (#1403) 2017-06-12 15:36:47 -07:00
Yusuke Miyazaki
8f476378e0 Update stub for tarfile (#1389) 2017-06-09 06:59:45 -07:00
Thomas Grainger
55f1883928 requests.(post|put|patch) json kwarg should be Any. (#1387)
```python
>>> requests.post('https://httpbin.org/post', json=["ham", "spam", {"eggs": "bacon"}]).json()
{'args': {}, 'data': '["ham", "spam", {"eggs": "bacon"}]', 'files': {}, 'form': {}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'close', 'Content-Length': '34', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.17.3'}, 'json': ['ham', 'spam', {'eggs': 'bacon'}], 'origin': '82.70.100.78', 'url': 'https://httpbin.org/post'}
>>> requests.post('https://httpbin.org/post', json=("ham", "spam", {"eggs": "bacon"})).json()
{'args': {}, 'data': '["ham", "spam", {"eggs": "bacon"}]', 'files': {}, 'form': {}, 'headers': {'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'close', 'Content-Length': '34', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.17.3'}, 'json': ['ham', 'spam', {'eggs': 'bacon'}], 'origin': '82.70.100.78', 'url': 'https://httpbin.org/post'}
```
2017-06-08 11:53:26 -07:00
Alex Khomchenko
25b3a818d3 add required to click.option decorator (#1397) 2017-06-08 11:52:25 -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
pkordas
4dd40465e7 added stub file for popen2 (#1385) 2017-06-05 12:27:34 -07:00
Carl Meyer
802f3b21b3 Fix __init__ signature for unittest.mock.MagicMock. (#1388) 2017-06-04 10:08:56 -07:00
amstree
1d4c73d708 Fix type annotations for glob (#1386) 2017-06-02 21:05:21 -07:00
Lukasz Langa
0b1f5db630 Remove spurious whitespace 2017-06-02 12:53:38 -07:00
mpage
dca968102e Fix stub for the ipaddress module (#1384)
* Fix stub for the ipaddress module

All methods that accept an "address" work on arbitrary objects. They
call str() on them and attempt to parse the result. As such, the type
of "address" should be object.
2017-06-02 12:49:12 -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
Michael Lee
d25c5b9ce4 Move stubs for 'click' into 2and3 folder (#1364) 2017-06-02 11:01:24 -07:00
Matthias Kramm
a02f9b6d46 switch order of ContextManager and Generic (#1382)
Since ContextManager inherits from Generic, too, listing Generic first, in the list of base classes, results in a cyclic MRO.
2017-06-01 18:06:43 -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
rchen152
2161f72990 time.mktime can take a struct_time or a tuple. (#1380) 2017-06-01 17:37:13 -07:00
Yusuke Miyazaki
35852bd687 Update stub for grp (#1373) 2017-06-01 17:36:32 -07:00
Alex Grönholm
37fc02ea7e Made Logger methods accept BaseExceptions for exc_info (#1376)
Loggers accept any exceptions as the exc_info argument, not only Exception subclasses.
2017-05-31 20:00:56 -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
Matthias Kramm
6f07424246 fix types in os.path (#1363)
In Python 2, doing
    os.path.join(u"foo", "bar")
is actually legal, and returns a unicode string.
Also os.path.relpath always returns the type of its first argument.

(The solution is not perfect -- e.g.
    os.path.join("a", "b", "c", "d", u"e")
will still result in a type error. )
2017-05-31 10:43:26 -07:00
Yusuke Miyazaki
2b79108ddc Fix stub for ujson (#1374) 2017-05-30 23:20:40 -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
Ethan Smith
be80c36816 fix mypy_selftest (#1369)
Related to python/mypy#3337.
2017-05-28 23:30:54 -07:00
amstree
e006fafe2a fix typo (#1367) 2017-05-28 19:09:29 -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
DmitriyS
9f433a57f4 Fix type stubs in typing.pyi (#1263) 2017-05-28 13:13:20 -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
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
Matěj Cepl
6f0c929658 Fix unittest.main() parameters. (#1351) 2017-05-27 14:40:55 -07:00
Doug Freed
56f3d66f47 ipaddress: make _BaseAddress subclass SupportsInt (#1361) 2017-05-26 09:36:29 -07:00
Jelle Zijlstra
9bbcb0822d add difflib.diff_bytes and difflib.Match (#1336) 2017-05-26 09:32:34 -07:00
Jelle Zijlstra
f8d06c88e5 fix reverse comparison in optparse (#1337) 2017-05-26 09:31:30 -07:00
Jelle Zijlstra
296f294b75 add fileinput.filelineno and fileinput.fileno (#1338) 2017-05-26 09:30:42 -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
c31dcf4088 Add more flags to socket (#1348)
Also switch to PEP 526-style types in socket.
2017-05-26 08:25:20 -07:00
Jelle Zijlstra
2800002ebf add to calendar stub (#1359) 2017-05-26 06:27:08 -07:00
Jelle Zijlstra
aeb19baa84 add symtable.symtable (#1360)
https://docs.python.org/3/library/symtable.html#symtable.symtable
and
https://docs.python.org/2/library/symtable.html#symtable.symtable
2017-05-25 19:39:15 -07:00