Commit Graph

4245 Commits

Author SHA1 Message Date
Alex Waygood
c653be73b8 Use TypeAlias for argparse type aliases (#7664) 2022-04-20 07:32:10 -07:00
Alex Waygood
85594df83b Use re-exports instead of TypeAliases in email.parser (#7665) 2022-04-20 07:31:52 -07:00
Alex Waygood
3930d8d12a Make several type aliases private (#7661) 2022-04-18 22:19:16 +01:00
Shantanu
67425a89d4 hashlib: update for py311 (#7652)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-04-18 21:21:19 +03:00
Alex Waygood
617d2aaf57 Fix crash when running mypy master against typeshed master (#7660) 2022-04-18 17:20:49 +01:00
Alex Waygood
eafc23ddb8 Add one more # noqa to unblock https://github.com/PyCQA/flake8-pyi/pull/213 (#7659)
Missed one.
2022-04-18 09:09:40 -07:00
Alex Waygood
54af68c789 Add a few # noqas to unblock PyCQA/flake8-pyi#213 (#7658) 2022-04-18 17:57:48 +02:00
Alex Waygood
073f9f416d Use PEP 585 syntax in collections (#7657) 2022-04-18 15:33:50 +01:00
Alex Waygood
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Sebastian Rittau
321359ca31 Add _typeshed.(Opt)ExcInfo (#7645) 2022-04-18 00:28:43 +01:00
Jelle Zijlstra
a24b765388 improve type for itertools.zip_longest (#7655) 2022-04-17 15:49:05 -07:00
Shantanu
a24ce3f935 dis: update for py311 (#7649) 2022-04-17 20:40:39 +03:00
Shantanu
b562089d13 ast: add TryStar in py311 (#7646)
Co-authored-by: hauntsaninja <>
2022-04-16 22:13:21 -07:00
Shantanu
556fe3e4ef weakref: use positional-only args (#7653)
Co-authored-by: hauntsaninja <>
2022-04-16 22:10:39 -07:00
Shantanu
435f758019 sqlite3: add py311 constants (#7654)
bpo-24139
2022-04-16 22:08:42 -07:00
Alex Waygood
7ce4607dee Upgrade flake8-pyi to 22.4.0, enable Y026 in .flake8 config (#7650) 2022-04-17 01:23:35 +01:00
Shantanu
145a85307a random: update for py311 (#7651) 2022-04-17 01:01:36 +01:00
Shantanu
520f807b5f builtins: default values for int.(to|from)_bytes in py311 (#7647)
See https://github.com/python/cpython/issues/89318
2022-04-17 00:57:13 +01:00
Shantanu
c93f92d92e builtins: add BaseExceptionGroup.__class_getitem__ (#7648) 2022-04-17 00:48:46 +01:00
Jelle Zijlstra
bedf520d76 typing(_extensions) updates for 3.11 (#7643) 2022-04-16 21:42:12 +02:00
Sebastian Rittau
499e74cf2a Add wsgiref.types (Python 3.11+) (#7644)
_typeshed.wsgi: Import from wsgiref.types in Python 3.11+

Make types match wsgiref.types
2022-04-16 21:36:31 +02:00
Jelle Zijlstra
b0611bc031 Improve sqlite3 types (#7641)
Read through the code in CPython and made the types more precise
where possible.

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-04-16 11:20:11 -07:00
Alex Waygood
2e98c8284c Move code from decimal.pyi to _decimal.pyi (#7640)
* Move code from `decimal.pyi` to `_decimal.pyi`

The stub previously did `from decimal import *` in `_decimal.pyi`, but the opposite happens at runtime.
2022-04-16 17:01:13 +01:00
Sebastian Rittau
7a3eb5a481 Use tuple instead of _typing.Tuple in ast (#7639) 2022-04-16 16:15:42 +01:00
Jelle Zijlstra
d802e65f67 sqlite3: add 3.11 additions (#7625)
- Blob from python/cpython#30680 (and anticipating that python/cpython#91550 will be merged)
- Aggregate window functions from python/cpython#20903
- Serialize/deserialize from python/cpython#26728
- Limit setting from python/cpython#28463
2022-04-16 16:09:26 +02:00
Sebastian Rittau
182fa6321c Update gettext translations (#7636)
* Use a protocol instead of `IO` for `fp` argument.
* Annotate a few missing return types.
* Mark some class constants as final.

Fixes #7628
2022-04-16 07:07:15 -07:00
Jelle Zijlstra
ee09d9eb19 builtins: Audit bytes arguments (#7631)
Most use the C buffer protocol, so _typeshed.ReadableBuffer is the right type. A few
check specifically for bytes and bytearray.
2022-04-16 14:16:11 +02:00
Alex Waygood
66bea8ca48 Use imports instead of TypeAliases in a couple places (#7634)
Fixes #7632
2022-04-16 01:38:59 -07:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Jelle Zijlstra
d09689f811 Add typing_extensions.assert_type (#7627)
Hasn't been released yet but I'd like it to be in the next mypy release.
2022-04-15 15:17:37 -07:00
Jelle Zijlstra
e0654bdbc0 ExceptionGroup: make it generic (#7626) 2022-04-15 16:24:17 +02:00
till
7f9be7fd00 Update linecache.pyi (#7623)
The `mtime` in linecache entries can be set to `None` for files loaded via a `__loader__` (cf: https://github.com/python/cpython/blob/3.10/Lib/linecache.py#L70)
2022-04-14 17:25:25 +01:00
Alex Waygood
40985b4f02 Fix various __all__ bugs and omissions (#7618) 2022-04-14 08:03:19 -07:00
Alex Waygood
a1b1b95f67 Unpin Python micro versions used by stubtest (#7619)
Add new `asyncio` method, fix allowlists
2022-04-13 22:07:01 +02:00
Jukka Lehtosalo
483550abe0 Drop some literal types from argparse (add_argument) (#7614)
These were introduced in #7329 and they cause false positives
in code that used to be accepted before.
2022-04-13 14:01:54 +02:00
Akuli
40553277ad asyncio: use WriteTransport in StreamWriter (#7611) 2022-04-09 07:03:34 -07:00
Will Frey
17b2f31b8c Use ReadableBuffer instead of bytes in base64.pyi (#7605) 2022-04-07 19:47:04 +02:00
Sebastian Rittau
ef819f3910 Remove pre-Python 3.6 branches from datetime.pyi (#7602) 2022-04-07 11:33:45 +02:00
Alex Waygood
3c85f36b7f Reduce code duplication in the email module (#7558) 2022-04-06 12:20:14 +02:00
Alex Waygood
1ceb486b75 Replace Union with union operator (#7596) 2022-04-05 23:07:31 +02:00
Marko Zagožen
8ae678129e Use Self return type for the 'replace()' methods in datetime classes (#7595) 2022-04-05 22:20:31 +02:00
Alex Waygood
b8f2eb3930 Make several fields on _dummy_threading classes read-only properties (#7588) 2022-04-05 08:35:00 +02:00
Alex Waygood
414f324083 Add missing __match_args__ attributes to several unix-only structseq classes (#7587) 2022-04-04 21:33:49 +01:00
Jelle Zijlstra
cfb1381c2e Add types.FunctionType.__module__ (#7581)
This exists on builtins.function but not here.
2022-04-02 17:44:17 -07:00
Joe Young
d45c9084a4 Catch more potential type errors in builtins.sum (#7578)
Use a ` TypeVar` bound to a `Protocol` defining `__add__`
2022-04-01 23:19:05 +01:00
Alex Waygood
646993c211 Improve imp._FileLike.__exit__ (#7577)
The signature of this method currently doesn't work quite as intended: see https://github.com/PyCQA/flake8-pyi/pull/199#issuecomment-1086087342

Classes will [still be accepted](https://mypy-play.net/?mypy=latest&python=3.10&gist=77efe095d01edeb1a4614166f0c9cf68) as conforming to this protocol if they have more permissive signatures such as `def __exit__(self, *args: object) -> None: ...`
2022-04-01 18:01:23 +01:00
Alex Waygood
da3e69d093 stdlib: Improve a bunch of __(a)exit__ methods (#7571) 2022-04-01 08:05:25 +02:00
Collin Anderson
e719f54432 _imp.create_dynamic returns ModuleType (#7568) 2022-03-31 22:38:43 +02:00
Steven Troxler
2d1d4b982f logging/handlers.pyi: atTime is datetime.time (#7566)
It is marked as having type `datetime.datetime` but `atTime`
refers to a time of day; only the fields on `datetime.time`
are used. The [docs](https://docs.python.org/3/library/logging.handlers.html#timedrotatingfilehandler)
clearly state that it is a `time`.
2022-03-30 19:17:36 +01:00
luzpaz
6550a30fdc Fix source comment typo (#7567)
Found downstream in mypy
2022-03-30 18:06:09 +01:00