Lee
8f77471d62
tkinter: remove unnecessary _MenuIndex TypeAlias (#8023 )
2022-06-08 09:23:54 +01:00
Alex Waygood
e7a5b7a762
Fix various __all__-related errors and omissions ( #8031 )
2022-06-07 23:29:55 +01:00
Alex Waygood
591593c85f
Simplify __all__ for modules beginning with 'm' to 't' ( #8028 )
2022-06-07 20:14:15 +01:00
Alex Waygood
b88ea4a499
Simplify __all__ for unittest and xml.etree ( #8029 )
2022-06-07 12:03:52 -07:00
Alex Waygood
e88a182573
Simplify __all__ definitions in modules beginning with 'a' to 'l' ( #8026 )
2022-06-07 15:40:48 +02:00
Sebastian Rittau
214bf15dce
Use "all +=" instead of duplicating the branches ( #7865 )
2022-06-07 13:32:19 +02:00
Alex Waygood
9db96967cc
asyncio.sslproto: More updates for py311 (#8022 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2022-06-06 15:12:22 -07:00
Alex Waygood
43a9ab08d7
Always use TypeAlias when assigning to Any ( #8021 )
2022-06-05 18:16:20 -07:00
Jim Bosch
a2ba0c8a00
use __new__ instead of __init__ for frozenset ( #8019 )
2022-06-04 08:31:13 -07:00
Alex Waygood
0ce825b5a8
Add unittest features new in Python 3.11 ( #8020 )
...
python/cpython@086c6b1
2022-06-04 16:27:52 +01:00
Lee
87893f3512
tkinter: annotate Listbox. ( #8006 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-06-03 18:08:03 +03:00
Jelle Zijlstra
56c8cbb314
Add GenericAlias.__typing_unpacked_tuple_args__ ( #8015 )
...
Fixes #8014
python/cpython#92484
2022-06-03 08:26:41 +01:00
Alex Waygood
acc0167dc1
Fix several new-in-3.11 stubtest errors ( #7973 )
2022-06-02 18:07:38 -07:00
Alex Waygood
6355cba923
Python 3.11: re.TEMPLATE is back in beta 2 ( #8007 )
2022-06-01 14:50:37 +02:00
Graham Bleaney
8c434e05d6
Add PEP 675 LiteralString overloads to str class ( #7725 )
...
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-31 21:09:34 -07:00
pranavrajpal
8f33ff9e9d
Add __setstate__ for BaseException ( #7987 )
2022-05-30 11:33:55 +02:00
hamdanal
b151e0c5a7
Make usage in argparse.HelpFormatter._format_usage optional ( #7983 )
...
closes #7982
2022-05-29 15:21:20 -07:00
Alex Waygood
d4eba8b5ce
builtins.sum: Add overload for bool special case (#7975 )
...
Closes #7974
2022-05-28 11:14:10 -07:00
Alex Waygood
ceccc655db
Introduce _typeshed.GenericPath and _typeshed.AnyStr_co ( #7970 )
2022-05-27 19:02:00 +01:00
Jelle Zijlstra
c35ec8ba89
contextlib: Remove explicit base class from ExitStack ( #7963 )
...
Fixes #7961
2022-05-27 09:19:18 -07:00
Alex Waygood
c05731c46f
tempfile.pyi: readability improvements (#7959 )
...
The name `_DirT` implies that it is a `TypeVar`, but it isn't; it's a generic `TypeAlias` that can be parameterised with a `TypeVar`. Rename it to just `_Dir` instead.
Also, use aliases instead of repeating incredibly long Literal annotations six times.
2022-05-27 08:52:44 +01:00
Jelle Zijlstra
7d34d75582
array: stub improvements ( #7966 )
...
- TypeVar changes from https://github.com/microsoft/pyright/issues/3501
- Fix pos-only param
- Use protocols instead of IO classes
2022-05-27 07:33:24 +01:00
Jelle Zijlstra
789c12ad90
constructors: Fix defaulted TypeVars ( #7965 )
...
From the list in https://github.com/microsoft/pyright/issues/3501
2022-05-27 07:32:56 +01:00
Alex Waygood
d511312e21
multiprocessing.managers: fix TypeVar usage (#7938 )
...
#7928
`dict()` and `list()` just return empty dictionaries and lists (respectively) if no arguments are supplied:
```python
>>> from multiprocessing.managers import SyncManager
>>> with SyncManager() as s:
... print(s.dict())
...
{}
```
2022-05-26 07:18:43 -07:00
Jelle Zijlstra
84e2ea113f
gettext: fix unconstrained TypeVar ( #7935 )
2022-05-26 07:10:47 +01:00
Alex Waygood
cb7742e12c
tempfile: Fix TypeVar usage (#7939 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2022-05-25 20:06:46 -07:00
Shantanu
c8f9abf41d
threading.Semaphore: add _value ( #7952 )
...
I've had occasion to use this multiple times. We already have _value for
asyncio.locks.Semaphore See also
https://github.com/python/cpython/issues/93213
Co-authored-by: hauntsaninja <>
2022-05-25 14:24:09 -07:00
Henry Schreiner
afb512f38b
sre_parse.SubPattern.getwidth: return a tuple of ints (#7951 )
2022-05-25 17:34:51 +01:00
Graham Bleaney
cb5b31cf15
Add LiteralString overloads to path module ( #7727 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-25 08:52:52 -07:00
Jelle Zijlstra
d5bc48d29b
builtins, collections: Fix unconstrained overloads for container constructors ( #7944 )
...
See https://github.com/microsoft/pyright/issues/3501#issuecomment-1135979479
Related to #7928
2022-05-25 10:07:23 +01:00
Jelle Zijlstra
d950ec37ca
fileinput: Fix TypeVar usage (#7934 )
...
* fileinput: Fix TypeVar usage
Fixes #7922 , part of #7928 .
2022-05-24 17:55:35 +01:00
Petter Friberg
c1aba8059f
Extend digest argument type for hmac.digest ( #7931 )
...
Now allows a `Callable` and `ModuleType` in addition to `str`
2022-05-24 11:38:00 +01:00
Jelle Zijlstra
158293257e
optparse: fix unconstrained TypeVar ( #7936 )
...
Part of #7928
2022-05-23 19:39:31 -07:00
Amy Pircher
8a07787f48
Add precise overloads for SSLContext.get_ca_certs ( #7933 )
2022-05-23 17:06:09 -07:00
Jelle Zijlstra
b4518bfb2b
argparse: remove incorrect default in overload ( #7929 )
...
Part of #7928
2022-05-23 18:12:19 +01:00
Shantanu
8968eb4fc9
bdb: update for py311 ( #7927 )
2022-05-23 09:20:48 +02:00
Jelle Zijlstra
9660ee97ee
codecs: add missing function, reflect runtime import * ( #7918 )
2022-05-22 16:06:21 -07:00
Jelle Zijlstra
18433202ba
concurrent.futures: new params in 3.11 ( #7919 )
...
fdc0e09c33
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-22 15:51:09 -07:00
Shantanu
ceda368abc
shutil: update rmtree for py311 ( #7925 )
2022-05-22 15:40:06 -07:00
Shantanu
c0aafb9a34
termios: update for py311 ( #7924 )
...
Co-authored-by: hauntsaninja <>
2022-05-22 15:36:50 -07:00
Shantanu
5b1ef8b119
mmap: add MADV_FREE on darwin ( #7923 )
...
Co-authored-by: hauntsaninja <>
2022-05-22 15:30:09 -07:00
Jelle Zijlstra
3dcfbf3745
urllib.request: add code 308 handler for 3.11 ( #7917 )
...
c379bc5ec9
2022-05-21 14:13:17 -07:00
Shantanu
f2ea124e82
random: explicitly mention int for seed ( #7916 )
...
https://github.com/python/typeshed/pull/7906#discussion_r878750404
I felt this better documents how seed is used in practice
Co-authored-by: hauntsaninja <>
2022-05-21 13:00:05 -07:00
Jelle Zijlstra
1220a99399
unicodedata: add UCD.is_normalized ( #7915 )
2022-05-21 12:59:44 -07:00
Jelle Zijlstra
ddc6eda10a
symtable: has_exec was removed in 3.9 ( #7911 )
2022-05-21 17:50:27 +02:00
Jelle Zijlstra
39c777f70c
pydoc: 3.11 changes ( #7910 )
2022-05-21 17:49:39 +02:00
Jelle Zijlstra
237b1bb189
binascii.a2b_base64: new param in 3.11 ( #7909 )
...
35b98e38b6
2022-05-21 08:36:03 -07:00
Jelle Zijlstra
9c0c631e46
gettext.install: names is kw-only in 3.11 ( #7908 )
2022-05-21 08:22:34 -07:00
Jelle Zijlstra
8b58371278
subprocess: new params in 3.11 ( #7907 )
2022-05-21 16:07:50 +01:00
Jelle Zijlstra
0198d75153
types: 3.11 (and earlier) fixes ( #7900 )
...
- New attributes in 3.11
- Arguments to CodeType.__init__ are always positional (have fun)
- co_consts can use object instead of Any
2022-05-21 07:37:11 -07:00