Commit Graph

2751 Commits

Author SHA1 Message Date
hauntsaninja
0505c100e1 inspect: update _ParameterKind for py38 (#3587) 2020-01-07 23:19:04 -08:00
hauntsaninja
da9b7dd7c8 token: add TYPE_COMMENT, remove AWAIT, ASYNC for py37 (#3588)
flake8 is a little picky about how we do checks against
sys.version_info
2020-01-07 23:18:53 -08:00
hauntsaninja
4aa6dfccdb pprint: update for py38, fix kwarg-only parameters (#3585) 2020-01-07 21:51:54 -08:00
hauntsaninja
485b85e6b8 csv: update DictReader for py38 (#3586) 2020-01-07 21:40:19 -08:00
hauntsaninja
b7a611e211 csv: more precise types, remove TODO (#3581) 2020-01-06 20:59:07 -08:00
hauntsaninja
1efc1baaf7 stdtypes: update for py38 (#3580) 2020-01-06 20:57:34 -08:00
hauntsaninja
e10b9c70b2 zipfile: update for py38 (#3572)
* zipfile: add Path, new in py38
* zipfile: use str over Text for py3 branches
* zipfile: add force_zip64 kwarg to open methods
2020-01-06 20:52:46 +01:00
Jens Hedegaard Nielsen
2cff4e615e BaseHTTPRequestHandler is a subclass of StreamRequestHandler (#3579) 2020-01-06 15:00:31 +01:00
layday
2bd06a0a3d Restrict shutil.move src argument to str (#3559)
See https://bugs.python.org/issue32689.
This bug only affects `src`s which are directory
Paths in Python 3.5 to 3.8 inclusive.
Comes at the cost of restricting
`src` to str even where a Path would work but
this might be preferable to exposing the bug.
2020-01-05 16:38:16 +01:00
hauntsaninja
ac2e59af81 shutil: update which for py38 (#3575) 2020-01-05 16:19:03 +01:00
hauntsaninja
45688b936e urllib: update for py38 (#3574)
* urllib.robotparser: add site_maps
* urllib.parse: add max_num_fields parameter
2020-01-05 16:17:23 +01:00
Alex Grönholm
7b5e9dca48 Added explicit SSLSocket.accept() definition (#3564) 2020-01-05 16:14:42 +01:00
hauntsaninja
64252bfef4 zipfile: fix typo in parameter for PyZipFile (#3573) 2020-01-05 16:12:44 +01:00
Daniel Farley
4fb4c80af7 Fix HTTPConnection timeout type (#3565)
`HTTPConnection` only passes timeout down to `socket.settimeout()` which is of type `Optional[float]` and has a specific action for `None`.  `HTTPConnection` should support the same behavior
2020-01-05 16:11:22 +01:00
Mickaël Schoentgen
b4d1da03aa Add missing Path.is_mount() introduced in Python 3.7 (#3566) 2020-01-05 16:04:52 +01:00
Jason
a1331accbe Update int.from_bytes to allow more than sequences (#3571)
`int.from_bytes` supports both iterables of ints and objects that define
__bytes__'.  As an example `int.from_bytes(iter([1, 0]), 'little'))`
returns 1.
2020-01-05 16:02:10 +01:00
hauntsaninja
b7530cc79e Add __init__ for subclasses of MappingView in python2 (#3570)
Resolves #3549 for python2
2020-01-05 15:11:38 +01:00
Faidon Liambotis
d87a4ffe0b socketserver.BaseRequestHandler: add missing hint (#3524)
Add hint for __init__().

Fixes #3523.
2020-01-03 08:48:49 -08:00
Jeppe Fihl-Pearson
fed3472e7c Reflect Python 3.8 updates to the pathlib stdlib module (#3568) 2020-01-03 08:47:50 -08:00
Alex Grönholm
f5a1925e76 Corrected type for "data" in two methods (#3562)
The documentation states:

* datagram_received: "data is a bytes object containing the incoming data."
* pipe_data_received: "data is a non-empty bytes object containing the received data."
2019-12-29 16:03:53 +01:00
Alex Grönholm
83f9d833fb Fixed missing methods, wrong names and types (#3560)
Changes:

* Added the missing methods `selected_alpn_protocol()` and `version()` to `SSLObject`
* Fixed the naming of the `shared_ciphers()` method in `SSLSocket` and `SSLObject` (was missing the last "s")
* Fixed return type of `cipher()` (it's documented to return `None` if no connection has been established)
* Fixed second argument in cipher and shared_ciphers

The TLS version is a string, like "TLSv1.2".

* Added explicit overloads for getpeercert()

Its return type can be determined statically based on the `binary_form` argument.
2019-12-29 16:02:18 +01:00
layday
21a9e69612 Update shutil.unpack_archive for 3.7 and up (#3558) 2019-12-27 11:26:26 +01:00
Batuhan Taşkaya
387ea1512a Add ast.unparse (#3557) 2019-12-26 16:06:10 +01:00
Rune Tynan
89602a89b9 Add antigravity module (#3555) 2019-12-21 14:48:00 -08:00
Maarten ter Huurne
703b01dd5e Add __init__ to MappingView and its subclasses (#3528)
While these implementations don't matter for the 'typing' module
itself, these are also imported to serve as the implementations
for the 'collection.abc' module.

Fixes #3029
2019-12-21 14:45:17 -08:00
François Freitag
462f71a212 Remove unused type _HTTPResponse (#3531)
Unused since 8e7c32846f.
2019-12-21 21:48:17 +01:00
Jelle Zijlstra
6b751ef408 shutil: Fix rmtree type (#3536)
See my comment in https://github.com/python/typeshed/issues/3533#issuecomment-563366251.
2019-12-21 12:29:59 -08:00
dave-shawley
c44a556fb0 Add typestubs for the warnings module (#3543) 2019-12-21 12:29:34 -08:00
Rune Tynan
0c563130fd Add dbm stubs (#3508) 2019-12-21 12:25:37 -08:00
Jelle Zijlstra
5021b30711 functools: remove first type param of cached_property (#3553)
Fixes #3547

This removes some type safety in exceptional cases, like code that interacts
directly with cached_property objects, but that seems like a price worth
paying.
2019-12-21 10:42:43 -08:00
layday
e404e1592d Preserve original type in total_ordering annotation (#3552)
See https://github.com/microsoft/pyright/issues/443
for reference.
2019-12-20 17:18:05 -08:00
Jan Verbeek
a705d59479 Add undocumented methods and make types more specific in 2/unittest (#3550) 2019-12-19 18:17:14 +01:00
Rune Tynan
4ed19cdaf5 Add stubs for winsound module (#3535) 2019-12-16 01:20:15 +01:00
Dave Halter
772f7a48e6 Make sure that the context manager for sqlite3.Connection works (#3542) 2019-12-14 10:08:37 +01:00
Reid Swan
3e638aa3c3 Add __enter__, __exit__ to IMAP4, make __init__ arguments optional (#3540)
Fixes #3537
2019-12-13 12:05:57 +01:00
Ophir LOJKINE
fda384fe0a Add date.__radd__ and datetime.__radd__ (#3539)
Fixes #3538
2019-12-12 18:38:51 +01:00
Alois Klink
a06abc5dff Make fieldnames of csv.DictReader Optional (#3534)
Also run stdlib/2and3/csv.pyi through black and isort
2019-12-09 20:22:42 +01:00
Jacob Ilias Komissar
39ebd62e71 Update stub for socket module (#3451)
* Add new socket constants from 3.7 and 3.8
* Also move TCP_NOTSENT_LOWAT to 3.7 section and add AF_ALG to AddressFamily
* Add missing and updated socket module (and class) methods
* Improve formatting of socket.pyi
    * Add missing line breaks in long function parameters
* Reorder to mirror module documentations
* Fix type of create_server's family parameter
* Add more system conditionals
* Remove CAPI; it isn't an int (it's a PyCapsule)
* Slightly improve version conditions in socket.pyi
* Add incomplete signatures for socket.sendfile and .sendmsg_afalg
* Add VM_SOCKETS_INVALID_VERSION to socket.pyi
* Remove private _GLOBAL_DEFAULT_TIMEOUT from socket.pyi
* Add mode-dependent return types to socket.makefile
    - For Python 2, return and mode types are based on those of 'open'
    - For Python 3, types are based on actual behaviors
* Mark recv_into and recvfrom_into's nbytes argument as optional
* Improve docstring for socket stub
2019-12-05 08:13:06 +01:00
Alois Klink
4766ca0846 Use Literal to improve SpooledTemporaryFile (#3526)
* Run black code formatter on tempfile.pyi
* Use Literal to improve SpooledTemporaryFile

Previously, SpooledTemporaryFile was always an AnyStr.
Now, we load a SpooledTemporaryFile[bytes] if we open in bytes mode,
and we load a SpooledTemporaryFile[str] if we open in str mode.
2019-12-05 08:04:53 +01:00
hauntsaninja
6b321548c4 random: fix type for sample (#3525)
Fixes #3374
2019-12-04 13:07:24 -08:00
cshesse
9a32f0d26a add raw property to BufferedIOBase (#3483) 2019-12-04 08:20:07 +01:00
Jelle Zijlstra
97f830030c Simplify WatchedFileHandler.__init__ (#3506)
Fixes #3502
2019-12-03 14:54:29 +01:00
Jelle Zijlstra
d215f502c6 Improve warnings stubs (#3501)
* merge 2and3 for _warnings

* move warn and warn_explicit into _warnings
2019-12-03 14:33:37 +01:00
Ran Benita
3934da12f6 __future__: add _Feature.compiler_flag (#3522)
Documented under the "CompilerFlag" paragraph here:
https://docs.python.org/3/library/__future__.html
2019-12-03 13:17:03 +01:00
Maksim Kurnikov
f7f68607ab SMTPChannel.push() accepts str (#3516) 2019-12-01 05:22:49 -08:00
Eugene Ha
92716c6821 Optional initial-value parameter for itertools.accumulate() (#3503) 2019-11-29 11:08:26 -08:00
Rune Tynan
359817bde9 In python versions 3.7 and above, re-export Pattern and Match (#3510) 2019-11-29 06:03:45 -08:00
hauntsaninja
5fdd6ad1a5 builtins.print: make sep and end Optional (#3468) (#3511)
The docs for Python 2 and Python 3 both explicitly mentions that None is a
valid value for sep and end.
https://docs.python.org/3/library/functions.html#print
2019-11-29 06:02:30 -08:00
robertschweizer
a9a4fd0d42 Add ImportError constructor arguments (#3512) 2019-11-29 06:01:30 -08:00
Denis Eliseev
74ac70bd28 Fix the signature of unittest.TestCase.assertLogs #3513 (#3514) 2019-11-29 06:00:16 -08:00