Commit Graph

1513 Commits

Author SHA1 Message Date
Jelle Zijlstra d261f14886 add constructors for configparser errors (#4215)
Fixes #4058

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-06-10 12:32:18 -07:00
Jelle Zijlstra ea577cec1f move OpenTextMode and friends to _typeshed (#4213) 2020-06-10 15:36:21 +02:00
Mikhail Golubev 85281b636e Add __class_getitem__ to builtins generified in PEP 585 (#4184)
* Add __class_getitem__ to builtins generified in PEP 585

* Declare types.GenericAlias and use it in __class_getitem__
2020-06-09 20:10:07 -07:00
Sebastian Rittau afe1e543b3 Make multiprocessing.Namespace accept any attribute (#4204)
Update multiprocessing.dummy.Namespace as well

Closes: #4186
2020-06-09 12:34:36 -07:00
Shantanu 72c8907760 tkinter: fix version availability (#4207)
Co-authored-by: hauntsaninja <>
2020-06-09 12:20:48 +02:00
Sam Bull 5f70d3721a Update root dbm module. (#4199) 2020-06-09 12:20:09 +02:00
Sebastian Rittau 206bff44ed Remove BinaryIO.write() (#4203)
write() is inherited from IO[bytes], where it's defined as
`def write(self, s: AnyStr) -> int: ...`. If AnyStr is bytes,
this should accept bytes, bytearray, and memoryview, so the
overload is unnecessary.

Closes: #4201
2020-06-08 13:40:41 -07:00
Christopher Head 51267a4b12 Add tkinter Event class (#4200) 2020-06-08 12:46:16 -07:00
Jaromir Latal c36e4517f7 [stdlib][asyncio] Accept optional context in (Timer)Handle (#4190) 2020-06-07 06:33:46 -07:00
Christopher Head 948c1a63e6 Relax asyncio.TimerHandle.__init__ args parameter (#4193)
Just like the Handle class, the TimerHandle class can take any sequence
here, not just a list.
2020-06-06 18:33:23 -07:00
Christopher Head 7931635b52 Add sys.{get,set}_asyncgen_hooks (#4195) 2020-06-06 15:44:48 -07:00
Christopher Head 5b36051f77 tkinter: fix variable parameter to wait_variable (#4194)
The tkinter `wait_variable` function can be called with either the name
of a variable (a `str`) or an actual variable object (a `Variable`).
2020-06-06 14:41:42 -07:00
Eric N. Vander Weele 4199352287 Fix typing.ForwardRef.__eq__ stub (#4177)
The return type of `__eq___` should be `bool`.

Otherwise, `mypy --disallow-any-unimported --no-silence-site-packages`
fails because the return type becomes `Union[bool, Any]` due to an
unfollowed import.
2020-06-06 08:04:05 -07:00
Jaromir Latal 9ab4ec568d [stdlib][asyncio] Widen asyncio.events.handle arguments type (#4188)
Co-authored-by: Jaromir Latal <jaro@fb.com>
2020-06-06 16:48:02 +02:00
Jaromir Latal 52bf411f2b [stdlib][asyncio] Allow optional policy in (#4189)
Co-authored-by: Jaromir Latal <jaro@fb.com>
2020-06-06 16:47:04 +02:00
Sam Bull 5b66868156 Allow Path in create_subprocess_* (#4159) 2020-06-04 17:11:53 +02:00
Sebastian Rittau a913af9523 flake8: Enable F811 (#4158) 2020-06-02 14:08:54 -07:00
Kevin Wojniak 17aa20cd95 Add st_file_attributes to stat_result for Windows (#4156)
This member is documented at https://docs.python.org/3/library/os.html#os.stat_result.st_file_attributes and https://docs.python.org/3/whatsnew/3.5.html#os

Co-authored-by: hauntsaninja <>
2020-06-01 23:53:11 -07:00
Rune Tynan 342ce69f88 Add missing asyncio modules (#4149) 2020-06-01 02:05:16 +02:00
Jelle Zijlstra adeda24fce open: introduce concrete return types (#4146)
* make io classes inherit from typing IO classes

This makes these classes usable if type annotations are given as "IO"
or "TextIO". In the future, we'll then be able to move open() to
return a concrete class instead (#3951).

* open: introduce concrete return types

Fixes #3951.

We use the values of the "mode" and "buffering" arguments to figure out
the concrete type open() will return at runtime. (Compare the CPython
code in https://github.com/python/cpython/blob/master/Modules/_io/_iomodule.c#L231.)
2020-06-01 00:48:12 +02:00
Rune Tynan d863210335 Improve TypeVar stub (#4150) 2020-05-30 20:27:59 -07:00
Jelle Zijlstra 3058bec873 make io classes inherit from typing IO classes (#4145)
This makes these classes usable if type annotations are given as "IO"
or "TextIO". In the future, we'll then be able to move open() to
return a concrete class instead (#3951).
2020-05-30 06:50:49 -07:00
Shantanu de2c2947fe windows: fix splitunc param name (#4143)
Co-authored-by: hauntsaninja <>
2020-05-29 20:37:19 -04:00
Rune Tynan 4381eba6f4 Add _sitebuiltins stubs (#4139) 2020-05-29 22:33:06 +02:00
Rune Tynan d035ce57e3 Add platform checks for various sys values (#4137)
* Add platform checks for various sys values

* Add windows-only constants
2020-05-28 19:00:31 -07:00
Tarcisio b58b8f3b43 Make BytesIO inherit from BufferedIOBase. (#4082)
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2020-05-28 17:07:00 -07:00
Shantanu 62304eb02f asyncio: update cancels for py39 (#4135)
Co-authored-by: hauntsaninja <>
2020-05-28 13:42:31 -07:00
Shantanu da2aa297a2 pathlib: update for py39 (#4134)
Co-authored-by: hauntsaninja <>
2020-05-28 13:41:53 -07:00
Shantanu feb43f7237 asyncio: add asyncio.threads for py39 (#4136) 2020-05-28 13:37:46 -07:00
Jelle Zijlstra c80622fbb9 remove type ignores about python/mypy#5027 (#4119)
The mypy issue got fixed by the good people of mypy. I did have to add an
override for __enter__ similar to what we're doing in #4082.
2020-05-28 09:51:54 -07:00
Ilaï Deutel 846d922df2 More precise return types for open(), Path.open(), bz2.open(), etc. (#3371)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2020-05-28 09:20:23 -07:00
Teddy Sudol 313a835bea Add missing definitions for urllib/response.pyi (#4118)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2020-05-28 13:48:27 +02:00
Jelle Zijlstra ca553cd589 fix type for ipaddress._BaseNetwork.overlaps (#4124) 2020-05-28 13:22:50 +02:00
Shantanu 2f0e3dbed2 statistics: add zscore in py39 (#4130)
Co-authored-by: hauntsaninja <>
2020-05-27 22:09:46 -07:00
Shantanu 1c0403cf83 random: various fixes (#4128)
* random.sample: make counts keyword-only

* random: mark positional-only args

* random.triangular: fix type of mode

* random: add randbytes

Co-authored-by: hauntsaninja <>
2020-05-27 22:05:55 -07:00
Shantanu c3c6abc153 gettext: various fixes (#4125) 2020-05-27 21:26:58 -07:00
Rune Tynan 0041206765 Fix _winapi version availability (#4120)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2020-05-27 20:47:15 -07:00
Shantanu e9531e0c18 _tracemalloc: precise types, deduplicate tracemalloc (#4083) 2020-05-27 20:36:21 -07:00
Rune Tynan 712f6d3709 Fix winreg pos-only args and parameter names (#4117)
* Fix winreg pos-only args and parameter names

* Fix consistency check
2020-05-27 20:22:32 -07:00
Shantanu 5cf2fb703a tempfile: fix TemporaryFile on Windows (#4112)
Co-authored-by: hauntsaninja <>
2020-05-27 20:22:01 -07:00
Ilya Konstantinov 1dc585385a lru_cache-wrapped function args must be Hashable (#3944) 2020-05-27 20:20:56 -07:00
Shantanu 2a13ba9415 compileall: update for py39 (#3956)
* compileall: add stripdir, prependdir and limit_sl_dest

* compileall: compile_dir's default value is now None

* compileall: update for current py39 (as of beta1)

Co-authored-by: hauntsaninja <>
2020-05-27 20:18:19 -07:00
Rune Tynan 7ba59719b6 Fix asyncio IocpProactor version availability (#4121) 2020-05-27 20:14:00 -07:00
Shantanu fd203e663e py39: add PEP 616 methods (#4090) 2020-05-27 19:24:25 -07:00
Shantanu 54c99ff75f asyncio: add shutdown_default_executor (#4115)
There are a couple other py39 changes to be made in asyncio, but I'm
trying to avoid merge issues with whitelists / Windows for now.

Co-authored-by: hauntsaninja <>
2020-05-27 18:35:39 -07:00
Rune Tynan fcdfacf944 Fix stubtest failures for socketserver on windows (#4103) 2020-05-27 19:34:35 +02:00
Rune Tynan 713a2729b4 Fix stubtest failures for asyncio on windows (#4092) 2020-05-27 19:08:19 +02:00
Rune Tynan ed4993bd50 Fix stubtest failures for os.__init__ on windows (#4098) 2020-05-27 17:25:30 +02:00
Rune Tynan e49c156d92 Add winreg stubs (#3794) 2020-05-27 17:15:08 +02:00
Ivan Levkivskyi e199c2e4bc Fix concurrent.futures import for re-export (#4105)
Also update stubtest whitelist as a workaround.
2020-05-27 13:51:01 +01:00