Commit Graph
1508 Commits
Author SHA1 Message Date
Sam BullandGitHub 5f70d3721a Update root dbm module. (#4199) 2020-06-09 12:20:09 +02:00
Sebastian RittauandGitHub 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 HeadandGitHub 51267a4b12 Add tkinter Event class (#4200) 2020-06-08 12:46:16 -07:00
Jaromir LatalandGitHub c36e4517f7 [stdlib][asyncio] Accept optional context in (Timer)Handle (#4190) 2020-06-07 06:33:46 -07:00
Christopher HeadandGitHub 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 HeadandGitHub 7931635b52 Add sys.{get,set}_asyncgen_hooks (#4195) 2020-06-06 15:44:48 -07:00
Christopher HeadandGitHub 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 WeeleandGitHub 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
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
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 BullandGitHub 5b66868156 Allow Path in create_subprocess_* (#4159) 2020-06-04 17:11:53 +02:00
Sebastian RittauandGitHub a913af9523 flake8: Enable F811 (#4158) 2020-06-02 14:08:54 -07:00
Kevin WojniakGitHubhauntsaninja <>
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 TynanandGitHub 342ce69f88 Add missing asyncio modules (#4149) 2020-06-01 02:05:16 +02:00
Jelle ZijlstraandGitHub 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 TynanandGitHub d863210335 Improve TypeVar stub (#4150) 2020-05-30 20:27:59 -07:00
Jelle ZijlstraandGitHub 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
ShantanuGitHubhauntsaninja <>
de2c2947fe windows: fix splitunc param name (#4143)
Co-authored-by: hauntsaninja <>
2020-05-29 20:37:19 -04:00
Rune TynanandGitHub 4381eba6f4 Add _sitebuiltins stubs (#4139) 2020-05-29 22:33:06 +02:00
Rune TynanandGitHub 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
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
ShantanuGitHubhauntsaninja <>
62304eb02f asyncio: update cancels for py39 (#4135)
Co-authored-by: hauntsaninja <>
2020-05-28 13:42:31 -07:00
ShantanuGitHubhauntsaninja <>
da2aa297a2 pathlib: update for py39 (#4134)
Co-authored-by: hauntsaninja <>
2020-05-28 13:41:53 -07:00
ShantanuandGitHub feb43f7237 asyncio: add asyncio.threads for py39 (#4136) 2020-05-28 13:37:46 -07:00
Jelle ZijlstraandGitHub 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
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
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 ZijlstraandGitHub ca553cd589 fix type for ipaddress._BaseNetwork.overlaps (#4124) 2020-05-28 13:22:50 +02:00
ShantanuGitHubhauntsaninja <>
2f0e3dbed2 statistics: add zscore in py39 (#4130)
Co-authored-by: hauntsaninja <>
2020-05-27 22:09:46 -07:00
ShantanuGitHubhauntsaninja <>
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
ShantanuandGitHub c3c6abc153 gettext: various fixes (#4125) 2020-05-27 21:26:58 -07:00
0041206765 Fix _winapi version availability (#4120)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2020-05-27 20:47:15 -07:00
ShantanuandGitHub e9531e0c18 _tracemalloc: precise types, deduplicate tracemalloc (#4083) 2020-05-27 20:36:21 -07:00
Rune TynanandGitHub 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
ShantanuGitHubhauntsaninja <>
5cf2fb703a tempfile: fix TemporaryFile on Windows (#4112)
Co-authored-by: hauntsaninja <>
2020-05-27 20:22:01 -07:00
Ilya KonstantinovandGitHub 1dc585385a lru_cache-wrapped function args must be Hashable (#3944) 2020-05-27 20:20:56 -07:00
ShantanuGitHubhauntsaninja <>
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 TynanandGitHub 7ba59719b6 Fix asyncio IocpProactor version availability (#4121) 2020-05-27 20:14:00 -07:00
ShantanuandGitHub fd203e663e py39: add PEP 616 methods (#4090) 2020-05-27 19:24:25 -07:00
ShantanuGitHubhauntsaninja <>
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 TynanandGitHub fcdfacf944 Fix stubtest failures for socketserver on windows (#4103) 2020-05-27 19:34:35 +02:00
Rune TynanandGitHub 713a2729b4 Fix stubtest failures for asyncio on windows (#4092) 2020-05-27 19:08:19 +02:00
Rune TynanandGitHub ed4993bd50 Fix stubtest failures for os.__init__ on windows (#4098) 2020-05-27 17:25:30 +02:00
Rune TynanandGitHub e49c156d92 Add winreg stubs (#3794) 2020-05-27 17:15:08 +02:00
Ivan LevkivskyiandGitHub e199c2e4bc Fix concurrent.futures import for re-export (#4105)
Also update stubtest whitelist as a workaround.
2020-05-27 13:51:01 +01:00
Rune TynanandGitHub 7ac284f641 Add _pydecimal and _decimal stubs (#4003) 2020-05-27 10:10:51 +02:00
Rune TynanandGitHub 8c7bfab7bd Fix stubtest failures for selectors on windows (#4100) 2020-05-27 09:55:27 +02:00
Rune TynanandGitHub a9375cf274 Fix stubtest failures for signal on windows (#4101) 2020-05-27 09:54:37 +02:00
Rune TynanandGitHub ab58c8148e Fix stubtest failures on _winapi (#4091) 2020-05-27 09:50:00 +02:00
Rune TynanandGitHub 5e80ca9e44 Fix stubtest failures for path files on windows (#4096) 2020-05-27 09:39:26 +02:00