Pavel Karateev
038556cb7e
Add codecs.unregister() for Python 3.10 ( #5539 )
2021-05-27 12:33:02 +02:00
Thomas Grainger
0a73982318
add asyncio.Task.get_coro return type ( #5536 )
2021-05-27 11:04:20 +02:00
Jelle Zijlstra
c4da3757d7
Improve tuple.__add__ type ( #5522 )
...
Noticed this while browsing the stub. This feels safe but we'll see what mypy-primer has to say.
2021-05-26 22:17:30 +02:00
Shantanu
74a8900166
mock: fix overloads ( #5534 )
...
* mock: fix overloads
Fixes #5533 . This changes the order and in some cases removes default
values from new.
* ignore incompatible overlaps
Co-authored-by: hauntsaninja <>
2021-05-26 22:16:51 +02:00
scaramallion
af33b09bf6
Use __new__ for datetime.timedelta ( #5532 )
2021-05-26 11:05:26 +02:00
scaramallion
a32d24cae0
Use __new__ for datetime.time ( #5530 )
2021-05-26 11:00:37 +03:00
Akuli
55a2a180c6
tempfile._TemporaryFileWrapper enhancements ( #5519 )
2021-05-25 15:30:08 +02:00
Shantanu
4bfdba71cb
dataclasses: update for py310 ( #5525 )
2021-05-25 14:43:06 +02:00
Pavel Karateev
781b76769e
Add sys.orig_argv for Python 3.10 ( #5524 )
2021-05-24 13:09:15 +02:00
Pavel Karateev
e7880085a2
Add sys.stdlib_module_names for Python 3.10 ( #5523 )
2021-05-23 15:25:32 +03:00
Neil Vyas
8d56328a24
change getattr stubs to better type the default argument and return type ( #5516 )
...
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-05-21 16:44:11 -07:00
Andrey
dbaaa3a103
PEP 604: Add ror operator and modify isinstance and subclass ( #5509 )
...
Add operators or and ror for types.Union and ror to the type class.
Also, add modified isinstance and issubclass signatures to support old-style and new-style unions inside.
2021-05-21 16:30:27 -07:00
Jelle Zijlstra
c4e3fd92cc
Adjust types for asyncio.coroutines functions ( #5517 )
...
Noticed this in mypy-primer output in #5516 on this code: https://github.com/encode/starlette/blob/master/starlette/testclient.py#L74
It calls `iscoroutinefunction()` on an object that may be None, which got flagged as an error but is actually fine; it just returns False.
We could also potentially use TypeGuard here, especially for `iscoroutine` which is just an `isinstance` call.
2021-05-21 23:07:06 +02:00
Sebastian Rittau
acca3181ed
Improve dict.fromkeys() with None value ( #5514 )
...
Closes : #5512
2021-05-21 20:30:33 +03:00
Jelle Zijlstra
19d6129624
Add __contains__ to gdbm.gnu ( #5511 )
...
Fixes #5510
2021-05-21 15:46:01 +02:00
Akuli
2628e77272
add _Pickler.dispatch and _Unpickler.dispatch ( #5508 )
2021-05-19 23:28:18 +03:00
Sebastian Rittau
21e647a184
Document _typeshed ( #5501 )
...
* Document _typeshed
Closes : #5486
* Allow README.md files
2021-05-19 22:15:21 +03:00
Sebastian Rittau
2c7bae6901
Use only literal overloads for ZipFile.__init__() ( #5504 )
2021-05-19 20:54:03 +02:00
David Reiss
1547035a95
Add _Pickler and _Unpickler to stdlib/pickle ( #5506 )
...
These are the pure-Python pickle implementation, and are sometimes used
by code that wants to extend or override parts of the
pickling/unpickling process.
2021-05-19 20:57:07 +03:00
Jukka Lehtosalo
e5459900c0
Make html, ipaddress, reprlib and winreg only available on Python 3 ( #5502 )
...
None of these are available in Python 2.7.
2021-05-19 12:16:10 +01:00
Jukka Lehtosalo
b08a2e6dea
Fix Python 2 genericpath.commonprefix ( #5500 )
...
The more specific overload item should come first. Also
fix the return type.
2021-05-19 12:56:18 +02:00
Thomas Grainger
f1dd6cad52
name can be any object ( #5494 )
2021-05-19 11:03:07 +02:00
Sebastian Rittau
54a0bd80ee
Add a comment about _typeshed to VERSIONS ( #5447 )
2021-05-19 11:01:33 +02:00
Sebastian Rittau
1ea3d0f003
tarfile improvements ( #5492 )
...
* Remove explicit Iterable super class
* Use Literals for mode parameters
* Import from collections.abc
* Use protocols for TarFile(fileobj=) and Tarfile.gzopen()
* Use object instead of Any as protocol return types
2021-05-19 10:13:35 +02:00
Sebastian Rittau
de0c62ffeb
zipfile: Replace an instance of IO with a protocol ( #5471 )
2021-05-18 18:42:59 -07:00
Jelle Zijlstra
bce19fc206
make GeneratorType inherit from Generator ( #5474 )
...
Fixes #5496
2021-05-18 13:31:14 -07:00
Mahmoud Harmouch
7d4ecf7f0a
Append some missing gdbm flags ( #5489 )
2021-05-17 19:33:29 -07:00
Sebastian Rittau
f0bf6eebbd
AnyStr cleanup ( #5487 )
...
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.
Part of #5470
2021-05-17 20:45:48 +02:00
Jade
56ebf92463
Make _TemporaryFileWrapper generic on AnyStr, use it ( #5456 )
...
* Make _TemporaryFileWrapper generic on AnyStr, use it
Previously it was not used on NamedTemoraryFile and thus the file
field was missing from the types for the return value of
NamedTemoraryFile.
2021-05-17 19:04:40 +03:00
Sebastian Rittau
7a9a107a63
Move IdentityFunction to _typeshed ( #5483 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2021-05-17 12:04:35 +02:00
Sebastian Rittau
a7302dc6cb
Add aliases for 'function classes' to multiprocessing ( #5346 )
...
Part of #4313
2021-05-16 12:46:17 -07:00
Sebastian Rittau
e5abd08f93
Replace PathLike unions with aliases from _typeshed ( #5467 )
...
Standardize on 'from os import PathLike'
2021-05-16 21:38:00 +02:00
Sebastian Rittau
6a9c89e928
Replace 'Text' with 'str' in py3 stdlib ( #5466 )
2021-05-16 07:10:48 -07:00
Sebastian Rittau
dbe77b6ae9
importlib.resources was added in 3.7 ( #5468 )
...
Describe sub-module versioning
2021-05-16 07:04:28 -07:00
Sebastian Rittau
4a3b6eb8d8
Update explanation for importing builtins.str ( #5465 )
2021-05-16 13:55:08 +02:00
Sebastian Rittau
841a365284
Remove compatibility aliases ( #5464 )
...
* Remove compatibility aliases
Remove a few instances of Text
Use aliases from _typeshed
* Remove unused imports
2021-05-15 20:49:20 +03:00
Akuli
17dcea4a68
Akuli and srittau: Remove Python 2 branches from Python 3 stubs ( #5461 )
...
* run script and do some manual changes (Akuli)
* do the whole thing manually (srittau)
* merge changes (Akuli)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
2021-05-15 15:33:39 +03:00
Akuli
15b0959cf8
stdlib/@python2: clean imports ( #5453 )
2021-05-15 01:08:37 +02:00
Akuli
5ec4f06263
clean python 3 specific stuff from stdlib/@python2 stubs ( #5451 )
2021-05-15 00:19:05 +02:00
Jelle Zijlstra
a47ee3245a
fix renamed Python 2 modules ( #5450 )
2021-05-14 14:36:00 -07:00
Sebastian Rittau
5b739e0ccb
Split stdlib into Python 2 and 3 versions ( #5442 )
...
All new files in stdlib/@python2 are straight copies of the
corresponding files in stdlib.
2021-05-14 12:04:12 -07:00
Jukka Lehtosalo
17bc1d83ea
Don't import enum in Python 2 stubs ( #5445 )
...
Python 2.7 doesn't have enum in the stdlib, in particular, so we
shouldn't import it.
2021-05-14 15:29:54 +02:00
Sebastian Rittau
322396bb32
configparser available since Python 3.0 ( #5443 )
...
It was called ConfigParser in Python 2.
Split out from #5442 .
2021-05-14 05:24:50 -07:00
hatal175
b8e5f637b9
Stubtest fixes ( #5391 )
2021-05-13 18:20:55 -07:00
Sebastian Rittau
d98fdd934c
Move VERSIONS description to file itself ( #5434 )
2021-05-13 06:14:44 -07:00
Shantanu
6bb1d885c6
time: fix constants availability ( #5419 )
2021-05-12 08:35:39 +02:00
spaghEddieDoyle
4c72f7f268
Add some missing logging features ( #5388 )
2021-05-11 10:52:40 +02:00
Shantanu
dd73f117f0
os: fix positional-only args ( #5412 )
...
Co-authored-by: hauntsaninja <>
2021-05-11 10:47:12 +02:00
Shantanu
a30ef0db04
pwd: fix positional-only args ( #5413 )
...
Co-authored-by: hauntsaninja <>
2021-05-11 10:46:26 +02:00
Shantanu
a91c89ea94
various path stubs: re-export to reduce duplication ( #5382 )
...
Co-authored-by: hauntsaninja <>
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-05-10 22:27:13 -07:00