c0aafb9a34
termios: update for py311 ( #7924 )
...
Co-authored-by: hauntsaninja <>
2022-05-22 15:36:50 -07:00
5b1ef8b119
mmap: add MADV_FREE on darwin ( #7923 )
...
Co-authored-by: hauntsaninja <>
2022-05-22 15:30:09 -07:00
Jelle Zijlstra and GitHub
3dcfbf3745
urllib.request: add code 308 handler for 3.11 ( #7917 )
...
https://github.com/python/cpython/commit/c379bc5ec9012cf66424ef3d80612cf13ec51006
2022-05-21 14:13:17 -07:00
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 and GitHub
1220a99399
unicodedata: add UCD.is_normalized ( #7915 )
2022-05-21 12:59:44 -07:00
Jelle Zijlstra and GitHub
ddc6eda10a
symtable: has_exec was removed in 3.9 ( #7911 )
2022-05-21 17:50:27 +02:00
Jelle Zijlstra and GitHub
39c777f70c
pydoc: 3.11 changes ( #7910 )
2022-05-21 17:49:39 +02:00
Jelle Zijlstra and GitHub
237b1bb189
binascii.a2b_base64: new param in 3.11 ( #7909 )
...
https://github.com/python/cpython/commit/35b98e38b6edd63153fc8e092f94cb20725dacc1
2022-05-21 08:36:03 -07:00
Jelle Zijlstra and GitHub
9c0c631e46
gettext.install: names is kw-only in 3.11 ( #7908 )
2022-05-21 08:22:34 -07:00
Jelle Zijlstra and GitHub
8b58371278
subprocess: new params in 3.11 ( #7907 )
2022-05-21 16:07:50 +01:00
Jelle Zijlstra and GitHub
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
Alex Waygood and GitHub
76a4bd796b
Simplify and correct many numeric unions ( #7906 )
...
Unblocks PyCQA/flake8-pyi#222
2022-05-21 15:25:00 +01:00
7576805aee
zipfile: 3.11 fixes ( #7898 )
...
* zipfile: 3.11 fixes
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-21 09:22:32 +01:00
Jukka Lehtosalo and GitHub
cd039c9b73
Ignore mypy errors in Python 2 builtins and typing ( #7894 )
...
Similar errors are already ignored in Python 3 stubs. The
errors break Python 2 tests of mypy.
See https://github.com/python/typeshed/issues/7367#issuecomment-1131472225
for context.
2022-05-20 15:27:09 +01:00
Jelle Zijlstra and GitHub
e7cbde0928
xml: stubtest fixes ( #7890 )
2022-05-20 13:03:45 +02:00
Jaakko Lappalainen and GitHub
611fa18b5c
Use bytes for resp param of imaplib.Internaldate2tuple ( #7892 )
2022-05-20 12:45:20 +02:00
Jelle Zijlstra and GitHub
26fa57ab78
traceback: update for py311 ( #7886 )
2022-05-19 19:14:12 -07:00
Jelle Zijlstra and GitHub
0b7df3b2aa
dataclasses: fix and sort stubtest complaints ( #7888 )
2022-05-19 19:13:22 -07:00
Jelle Zijlstra and GitHub
4220712aab
dis: add adaptive argument for 3.11 ( #7889 )
2022-05-19 18:27:34 -07:00
64766c8521
locale: add locale.getencoding ( #7887 )
...
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
2022-05-19 18:20:16 -07:00
Jelle Zijlstra and GitHub
6f2c53f3b0
_imp: fix stubtest issues, add Python 3.11 items ( #7878 )
2022-05-19 14:43:58 +02:00
Jelle Zijlstra and GitHub
250f3d92e7
ast: fix stubtest issues ( #7877 )
...
Add annotations for `_ast.Tuple.dims` and `ast.main()`. Add allowlist comments for others.
2022-05-19 10:13:08 +01:00
Alex Waygood and GitHub
04dde4d000
enum: More changes for 3.11 (#7862 )
2022-05-18 19:35:22 -07:00
Winston Chang and GitHub
6653be1511
Add overloads for asyncio.sleep() ( #7873 )
...
Closes #7866 . This adds an overload to `asyncio.sleep()`, so that when it is called _without_ `return=None`, the type checker knows that the return type is `None` instead of `unknown`.
Also related to https://github.com/microsoft/pyright/issues/3475 .
2022-05-18 16:19:45 -07:00
Jelle Zijlstra and GitHub
7998906226
re: 3.11 fixes ( #7859 )
2022-05-17 21:42:23 -07:00
Jelle Zijlstra and GitHub
bd394d2486
builtins: add BaseException.add_note in py311 ( #7860 )
2022-05-17 20:32:28 -07:00
Jelle Zijlstra and GitHub
a01f98c361
sqlite3.Blob: fix stubtest errors ( #7858 )
2022-05-17 19:50:19 -07:00
8f5a83516b
tempfile.SpooledTemporaryFile: inherit from IOBase on 3.11 ( #7802 )
...
python/cpython#29560
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-17 18:41:47 -07:00
eab82c838a
asyncio: updates for 3.11 ( #7844 )
...
CPython changes:
- https://github.com/python/cpython/commit/13c10bfb777483c7b02877aab029345a056b809c
- https://github.com/python/cpython/commit/9523c0d84f351a610dc651b234461eb015fa3b82
- https://github.com/python/cpython/commit/9f04ee569cebb8b4c6f04bea95d91a19c5403806
- https://github.com/python/cpython/commit/d03acd7270d66ddb8e987f9743405147ecc15087
- https://github.com/python/cpython/commit/195a46d6ffd4cec6c5fb69c5890f8b1758ac91ca
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com >
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2022-05-17 18:11:29 -07:00
Carl Meyer and GitHub
7ca8303672
CodeType.co_linetable is of type bytes ( #7856 )
...
Although the specific format of the bytes is opaque and undocumented, the fact that it will be bytes is stable.
This is necessary in order for type checkers to allow creating one code object from another, since the `lnotab`
positional argument to `__init__` is typed as bytes.
2022-05-17 11:49:12 -07:00
171ea08f0d
Add __class_getitem__ to classes in logging and csv ( #7830 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2022-05-17 14:12:42 +01:00
Sebastian Rittau and GitHub
f21898abb9
Improve I/O types in socket.pyi ( #7852 )
...
* Use a protocol for socket.sendfile() "file" argument.
* Use concrete classes for socket.makefile() return types.
2022-05-17 06:11:50 -07:00
Sebastian Rittau and GitHub
e1bd9c73f0
Use I/O protocols in codecs.pyi ( #7849 )
2022-05-17 15:01:57 +02:00
Alex Waygood and GitHub
e9526faf40
Various py311 removals ( #7836 )
2022-05-16 17:28:13 -07:00
Jukka Lehtosalo and GitHub
21a81c6575
sqlite3: Avoid optional type for 'description' ( #7842 )
...
Use the `| Any` trick instead, since it seems that in a lot of
code the value can be predicted to be non-`None` (if a query
has been executed previously, I think).
The docs don't mention the possibility of this being `None`, so
it seems likely that a lot of code doesn't check for it:
https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.description
2022-05-16 14:54:15 +02:00
Jukka Lehtosalo and GitHub
dca33e5f8d
gettext: Make GNUTranslations.CONTEXT not final ( #7841 )
2022-05-16 13:32:02 +02:00
Adam Simpkins and GitHub
40d6592ba1
tarfile.gettarinfo() accepts PathLike objects ( #7832 )
...
This method has accepted PathLike objects since Python 3.6
(https://github.com/python/cpython/pull/512 )
2022-05-11 22:02:04 -07:00
Rick Voormolen and GitHub
693c4f19b4
Mark Future._callbacks as a @property ( #7829 )
2022-05-11 11:13:29 +02:00
Shantanu and GitHub
a27f15ef0e
builtins: reorder overloads ( #7828 )
...
This is slightly more friendly for --no-strict-optional (gross)
2022-05-11 01:00:52 -07:00
Shantanu and GitHub
75d2f6c881
statistics: improve type for median_grouped ( #7825 )
2022-05-11 08:06:35 +02:00
Shantanu and GitHub
032787d867
builtins: accept old-style iterables to iter ( #7817 )
2022-05-10 09:06:31 +02:00
Alex Waygood and GitHub
ac30b96d14
Use str instead of Text ( #7812 )
2022-05-09 20:47:11 +01:00
Jelle Zijlstra and GitHub
5c13f8bbce
ast: FormattedValue.conversion cannot be None ( #7810 )
...
```
In [4]: ast.dump(ast.parse('f"{x!r}"'))
Out[4]: "Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=114)]))], type_ignores=[])"
In [5]: ast.dump(ast.parse('f"{x}"'))
Out[5]: "Module(body=[Expr(value=JoinedStr(values=[FormattedValue(value=Name(id='x', ctx=Load()), conversion=-1)]))], type_ignores=[])"
```
(On 3.9 but I don't think this has changed since 3.6.)
The stdlib also assumes this: https://github.com/python/cpython/blob/main/Lib/ast.py#L1211 (`chr(None)` doesn't work).
2022-05-08 19:42:38 -07:00
Mix and GitHub
32f474d6ef
subprocess: improve Popen.returncode type ( #7806 )
2022-05-08 16:53:44 -07:00
Alex Waygood and GitHub
3ed7e3ba50
csv: annotate keyword arguments in various functions and methods ( #7788 )
2022-05-07 21:01:20 -07:00
Alex Waygood and GitHub
4e946b74bf
csv.pyi: minor cleanup (#7790 )
2022-05-07 10:49:27 +02:00
Jelle Zijlstra and GitHub
6b5068b11d
Add new arguments to subprocess.Popen ( #7798 )
2022-05-07 09:49:23 +03:00
Alex Waygood and GitHub
16ca92fac7
Add http.HTTPMethod ( #7784 )
...
https://github.com/python/cpython/pull/91997
`description` isn't actually read-only at runtime, but I don't think there's any other way of telling type checkers "this is an attribute that the members have, not a member itself". And pretending it's a property is already what we do for `HTTPStatus`, which has the same issue.
2022-05-06 23:48:52 -07:00
Jelle Zijlstra and GitHub
031c998055
enum: Add member and nonmember ( #7795 )
...
python/cpython#92366
2022-05-07 07:48:34 +01:00
Akuli and GitHub
58f2e317c1
tkinter: add _windowingsystem() ( #7803 )
2022-05-06 23:45:47 -07:00