Commit Graph

1019 Commits

Author SHA1 Message Date
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
Jelle Zijlstra
6f5c6b5078 add some missing constants (#1198)
Closes #2
2017-04-24 15:05:02 -07:00
Jelle Zijlstra
56bc0f5766 rewrite _operator stubs (#1196)
Fixes #835
2017-04-24 15:04:42 -07:00
Jelle Zijlstra
4ea4bf63f8 add some missing names to abc.pyi (#1199)
Fixes #304
2017-04-24 15:04:16 -07:00
Jelle Zijlstra
8f1875b97b fixes to xml.sax (#1201) 2017-04-24 15:03:07 -07:00
Jelle Zijlstra
e8e002d9c0 stubs for smtpd (#1203) 2017-04-24 15:02:51 -07:00
Jelle Zijlstra
0fcece539b Stubs for sched (#1204)
* stubs for sched

* can't use NamedTuple classes
2017-04-24 15:02:25 -07:00
Jelle Zijlstra
5a20d41d4a stubs for reprlib (#1205) 2017-04-24 14:57:26 -07:00
Jelle Zijlstra
bea973ac22 stub for pty (#1206)
https://docs.python.org/3/library/pty.html
2017-04-24 13:55:33 -07:00
Jelle Zijlstra
3e51331118 fix parent classes of mmap (#1190)
Fixes #1184
2017-04-22 15:55:23 -07:00
Jelle Zijlstra
1350d7e4d2 Fixes for datetime and relativedelta (#1191)
Fixes #1163.
2017-04-22 15:52:55 -07:00
Jelle Zijlstra
8dc082dce5 fix arg names in string.pyi (#1188) 2017-04-21 17:52:48 -07:00
Jelle Zijlstra
77af85649b Revert "Sadly symlinks don't work on Windows. (#1173)" (#1189)
This reverts commit 8b835f9500.

(Because we've fixed the issue in python/mypy#3213.)
2017-04-21 16:25:10 -07:00
Guido van Rossum
a934d57f3b [optparse] Change Uses of List[] to Sequence[] in argument positions. (#1179)
* Change Uses of List[] to Sequence[] in argument positions.

One of these (parse_args()) broke in real-world code, because the
expected type was List[Union[str, bytes]] but the actual type was
List[str] (because List is invariant).  That is ridiculous, so I
changed the accepted type to Sequence[_Text] which is covariant.  Then
I found a few other methods/functions that probably should also be
changed to Sequence, but I'm less certain of those.  I'm not at all
sure about the instance/class attributes, so I left those alone
(though I suspect those might also have to switch).

* Fixes suggested by code review

- Changed Sequence[Option] to Iterable[Option] everywhere
- Changed _process_args to plain List
2017-04-21 12:22:24 -07:00
Cooper Lees
6e1d915944 - Add support for PathLike to _PathType for Python 3.6 Unions only (#1165) 2017-04-21 10:13:33 -07:00
Jeremy Apthorp
55dc338bbf Add stub for asyncio.wrap_future (#1183)
Closes #1182.
2017-04-21 07:53:14 -07:00
Ethan
625ea80a99 update OptParse to work on 2and3 (#1164)
* update OptParse to work on 2and3

* remove duplicative dunder methods in Option

* Union Nones to Optional and Text->_Text
2017-04-19 06:10:07 -07:00
Sam Dunster
6582a8fb59 Add collections.abc.Collection (#1177) 2017-04-18 21:08:06 -07:00
Eddie Antonio Santos
244f89d8cd Add uri param for sqlite3.connect (Python 3.4+). (#1171) 2017-04-18 15:09:51 -07:00
Guido van Rossum
8b835f9500 Sadly symlinks don't work on Windows. (#1173)
So I have to make {ntpath,macpath}.pyi real copies of posixpath.pyi.
2017-04-18 11:55:02 -07:00
Guido van Rossum
bb0a841471 Make io._IOBase and its descendents concrete. (#1172)
This solves the issue with instantiating gzip.GzipFile() mentioned at
https://github.com/python/typeshed/pull/1160#issuecomment-294534004
2017-04-18 11:13:13 -07:00
Teddy Sudol
70f7f6cce6 Add more kwargs to distutils/core.setup() (#1170)
* Add more kwargs to distutils/core.setup()

These arguments are sourced from https://github.com/python-git/python/blob/master/Lib/distutils/core.py#L44 and https://github.com/python-git/python/blob/master/Lib/distutils/dist.py#L195

I do not claim that the list of kwargs is now complete.

* Add missing optional args values

* Remove duplicate, change "Dict" to "Mapping"
2017-04-17 15:06:36 -07:00
Teddy Sudol
243b67f0d2 Add compresslevel kwarg to tarfile (#1169)
https://docs.python.org/2/library/tarfile.html?highlight=compresslevel
2017-04-17 15:05:46 -07:00
Teddy Sudol
194c4c6eb0 Add stubs for *path.pyi in Python 3 stdlib (#1167) 2017-04-17 13:07:21 -07:00
Teddy Sudol
2961dddc1f Mark debuglevel argument as optional argument (#1168)
https://github.com/python-git/python/blob/master/Lib/urllib2.py#L1038
2017-04-17 13:06:47 -07:00
Teddy Sudol
f6619a4741 Add stubs for *path.pyi in Python 2.7 stdlib (#1166) 2017-04-17 13:06:35 -07:00
Matthias Kramm
7e58389a27 a better definition for io.IOBase (#1160)
* a better definition for io.IOBase

* move BinaryIO superclass into _io._IOBase

* remove write() from _TextIOBase
2017-04-17 09:42:59 -07:00
Michał Masłowski
2ffee9df1b Require warning categories to be subclasses of Warning (#343)
CPython _warnings module implementation accepts Warning subclasses and None, but not any subclass of BaseException
specified in the stub. The stub for warnings is correct.
2017-04-14 09:21:34 -07:00
David Euresti
5ba1a01216 Make webbrowser module unicode friendly in Python 2 (#1159)
* Make webbrowser module unicode friendly in Python 2

* CR changes
2017-04-13 20:15:37 -07:00
Łukasz Langa
03119a237d Partial lib2to3 stubs (#1096)
* Partial lib2to3 stubs

* Use typing.Text instead of str

* Add a _Path shortcut for managing PathLike

* Respond to review, pgen2/driver

* Respond to review, pgen2/grammar

* Respond to review, pgen2/parse

* Respond to review, pgen2/pgen

* Respond to review, pgen2/token

* Respond to review, pgen2/tokenize

* Respond to review, pytree

* Move to 2and3

* Make pytype happy

* Respond to review nits

* Move _RawNode, _Convert to pytree and make the latter return None

* Make concrete Symbols subclasses for python and pattern

* Add missing Callable import
2017-04-13 20:14:35 -07:00
Guido van Rossum
359c8cc313 Remove all mention of 'module' from typeshed. (#1156)
This depends on python/mypy#3107.
2017-04-13 08:40:52 -07:00
rchen152
51959f09c7 Change types.pyi syntax that pytype can't parse. (#1157)
* Fix a few return types in stdlib/2/inspect.pyi.

* Rename _FrameRecord to _FrameInfo

* Correct some return types in itertools.pyi from Iterable to Iterator.

* Change types.pyi syntax that pytype can't parse.
2017-04-12 16:11:03 -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
nimin98
20d9fcf858 Support callable contextmanagers in contextlib (#1152)
mypy could not recognize the case when we use contextmanager as a
decorator, which has been supported since Python 3.2.

In the following code snippet,

from contextlib import contextmanager

@contextmanager
def foo(arg1):
    try:
        print(arg1)
        print('1')
        yield
    finally:
        print('2')

@foo('0')
def foo2():
    print('3')

foo2()

we get mypy error as follows,
error: ContextManager[Any] not callable

The suggested changes can fix this error and properly reflect the
updated contextmanager usage pattern.
2017-04-11 14:51:03 -07:00
David Euresti
26360e821b Merge stdlib/{2,3}/os/path.pyi (#1150)
* Merge stdlib/{2,3}/os/path.pyi

To be renamed into stdlib/2and3/os/path.pyi later.

Also fixes #50

* CR fixes
2017-04-09 19:27:25 -07:00
Jelle Zijlstra
aa0d0d152e fix typos in uiid (#1151)
From #1148
2017-04-09 18:15:58 -07:00
David Euresti
a7f87bb006 Merge uuid module into 2and3 (#1148)
* Merge and improve uuid module

* Move uuid into 2and3

* Fix mistyped things, add compare operators
2017-04-09 18:05:03 -07:00
David Euresti
f741429a75 Move socket into 2and3 (#1149)
* Merge socket modules

* Move socket to 2and3
2017-04-07 18:01:33 -07:00
David Euresti
8bed2fce93 Merge binascii module into 2and3 (#1144)
* Unify binascii module

* Move binascii to 2and3

* CR fixes

* Fix flakes

* Fix flakes better
2017-04-06 21:53:38 -07:00
Roy Williams
452c1e1d78 Fix patch.object to return a _patch context manager. (#1142)
* Fix patch.object to return a _patch context manager.

This should fix https://github.com/python/typeshed/issues/914

* Prefer None over ... to be consistent with the rest of the file.
2017-04-06 18:47:28 -07:00
David Euresti
6e75432504 Merge token module into 2and3 (#1146)
* Merge token module; add values from 3.5

* Move token to 2and3

* Switch to ellipsis for token
2017-04-06 18:46:14 -07:00
Carl Meyer
166e56a8f0 Fix missing 'type: ' in opcode.pyi (#1143) 2017-04-05 17:06:09 -07:00
David Euresti
8401fc6838 Move __future__ module into 2and3 (#1140)
* Merge __future__

* Move __future__ into 2and3
2017-04-05 13:54:46 -07:00
David Euresti
26f5ffd5ba Add stubs for cmd (#1128) 2017-04-05 13:54:05 -07:00
David Euresti
b9616f1517 Merge base64 module into 2and3 (#1141)
* Merge base64 module

* Move base64 into 2and3
2017-04-05 13:51:26 -07:00
Jelle Zijlstra
f7e4cb8c79 make enums support len() (#1139) 2017-04-05 08:22:28 -07:00
John Reese
8510adfe05 Add socket enum classes from py3.4+ (#1121)
* Add socket enum classes from py3.4+

Adds four IntEnum classes in the socket module that mirror the
AF_, AI_, MSG_, and SOCK_ sets of constants.

* Update socket AddressInfo/MsgFlag to use IntFlag type

* IntFlag, AddressInfo, and MsgFlag are py 3.6+
2017-04-04 23:49:01 -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
David Euresti
47c325c0ae Merge _random into 2and3 (#1134)
* Merge random module

* Move _random into 2and3
2017-04-04 20:14:07 -07:00
David Euresti
bc2234dba2 Merge zlib into 2and3 (#1130)
* Fix types and merge zlib.pyi

* Move zlib into 2and3
2017-04-04 20:13:23 -07:00