Alex Waygood
28a760cd2c
Improve pyclbr.pyi ( #7229 )
2022-02-16 07:01:27 -08:00
Alex Waygood
fbc279e3f5
stdlib: Add many missing dunder overrides ( #7231 )
2022-02-16 06:25:47 -08:00
Alex Waygood
1341a34525
Remove unused allowlist entries in babel and requests ( #7233 )
2022-02-15 16:26:13 -08:00
Alex Waygood
3567aaa93f
Fix positional-only differences in sqlite3 ( #7222 )
2022-02-15 13:01:26 -08:00
Alex Waygood
5e8a2a9364
Fix various pos-only stubtest complaints previously allowlisted ( #7228 )
2022-02-15 17:51:34 +01:00
Alex Waygood
1317fa7af9
Fix positional-only differences in threading.local ( #7227 )
...
Last one of these, I think.
2022-02-15 07:16:20 -08:00
Alex Waygood
4ab5033e5b
Make mailbox.MailDir abstract ( #7201 )
2022-02-15 06:47:17 -08:00
Alex Waygood
96b06adf2c
Add missing descriptor methods in dataclasses and functools ( #7203 )
2022-02-15 06:45:49 -08:00
Alex Waygood
e976ee1988
Improve traceback.FrameSummary ( #7210 )
2022-02-15 06:43:11 -08:00
Alex Waygood
5e7909d9b3
Fix positional-only differences in types ( #7220 )
2022-02-15 06:27:09 -08:00
Alex Waygood
7595e2e79b
Fix positional-only differences in xml ( #7225 )
2022-02-15 06:22:31 -08:00
Alex Waygood
24cfd431a8
Fix positional-only differences in ctypes ( #7223 )
2022-02-15 06:22:14 -08:00
Alex Waygood
2f0fac0cd9
Fix positional-only differences in _tkinter ( #7224 )
2022-02-15 06:21:50 -08:00
Alex Waygood
f4967618dd
Fix positional-only differences in many stdlib modules ( #7226 )
2022-02-15 15:14:06 +01:00
Alex Waygood
32e9a0fbc1
Fix positional-only differences in sys ( #7221 )
2022-02-15 15:12:58 +01:00
Alex Waygood
690975b55d
types: Add several missing __(qual)name__ attributes (#7216 )
2022-02-15 08:07:39 +01:00
Alex Waygood
a67c316d08
Add a few missing dunders in builtins ( #7214 )
2022-02-14 15:07:38 -08:00
Alex Waygood
2878050ffc
Add @final to several stdlib classes that cannot be subclassed at runtime ( #7213 )
2022-02-14 14:46:30 -08:00
Alex Waygood
a8141e14ae
Add itertools.repeat.__length_hint__ method ( #7212 )
2022-02-14 14:13:13 -08:00
Alex Waygood and Jelle Zijlstra
11efe034bb
collections: Add missing reflected BinOp methods (#7207 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2022-02-14 13:03:40 -08:00
Alex Waygood
5972da2e2d
Add EnumMeta.__bool__ ( #7206 )
...
Most Python objects evaluate as falsey if they have length 0, but an enum class is truthy even if it has length 0.
Source code: https://github.com/python/cpython/blob/841c77d802e9ee8845fa3152700474021efe03fd/Lib/enum.py#L353
2022-02-14 13:03:17 -08:00
Alex Waygood
dea12b2c47
Add missing __isabstractmethods__ attributes in abc and `functools1 ( #7205 )
2022-02-14 11:20:07 -08:00
Alex Waygood
66a229b709
stdlib: Add several missing comparison methods ( #7202 )
2022-02-14 11:09:52 -08:00
Alex Waygood
f3ad0179f8
Fix return types in codecs ( #7199 )
2022-02-14 14:03:58 +01:00
Alex Waygood
7682ae957a
cmd.Cmd.default returns None, not bool (#7193 )
2022-02-14 09:24:29 +01:00
Alex Waygood
b0f2bd68b0
Improve tempfile.SpooledTemporaryFile ( #7196 )
2022-02-13 17:41:54 -08:00
Alex Waygood
65002d2e69
threading: Semaphore.__exit__ & _RLock.__exit__ always return None (#7195 )
...
`_RLock.__exit__`: https://github.com/python/cpython/blob/1d6ce67c29aa2166ef326952cb605b908fb4f987/Lib/threading.py#L199
`Semaphore.__exit__`: https://github.com/python/cpython/blob/1d6ce67c29aa2166ef326952cb605b908fb4f987/Lib/threading.py#L487
2022-02-13 17:41:17 -08:00
Alex Waygood
cabfaabd76
optparse.HelpFormatter: format_heading and format_usage are abstract methods (#7194 )
...
The [docstrings state](https://github.com/python/cpython/blob/0ae40191793da1877a12d512f0116d99301b2c51/Lib/optparse.py#L255-L259 ) "Subclasses must implement", and the [docs for optparse](https://docs.python.org/3/library/optparse.html ) explicitly state that `TitledHelpFormatter` and `IndentedHelpFormatter` are provided as "concrete implementations" of `optparse.HelpFormatter`.
2022-02-13 17:41:00 -08:00
Alex Waygood
68e2a74a79
pathlib.Path.__exit__ always returns None (#7192 )
...
Source code here: https://github.com/python/cpython/blob/0ae40191793da1877a12d512f0116d99301b2c51/Lib/pathlib.py#L893
It has always returned `None`, by the looks of things.
2022-02-13 17:14:13 -08:00
Alex Waygood
0109a371d6
Improve webbrowser stubs ( #7190 )
...
- `BaseBrowser.open` is an abstract method that should be overridden in all subclasses.
- `UnixBrowser.open` only accepts 0, 1 or 2 for the `new` parameter.
2022-02-13 17:10:43 -08:00
Alex Waygood
7f472e94e5
Improve collections.UserString ( #7189 )
2022-02-13 17:09:06 -08:00
Alex Waygood
63489c305d
asyncio: make AbstractServer abstract and remove unnecessary metaclass=ABCMeta (#7185 )
2022-02-13 23:34:19 +02:00
Alex Waygood
03dbe2206c
Improve pathlib stubs ( #7181 )
2022-02-12 18:42:04 -08:00
Alex Waygood
da7604a968
Add stubs for pyflakes ( #7175 )
2022-02-11 12:21:28 +01:00
Alex Waygood
4b75ecbbe2
Use Self in Python 2's array.__imul__ ( #7167 )
2022-02-08 10:54:16 -08:00
Alex Waygood
5f830d023f
Backport more Self-related changes to Python 2 ( #7166 )
2022-02-08 09:52:43 -08:00
Alex Waygood
398a5807a1
Return Self from MutableSequence.__iadd__ ( #7162 )
2022-02-08 06:15:37 -08:00
Alex Waygood
b1b3471c76
Improve in-place BinOp methods for sets ( #7161 )
2022-02-08 14:57:50 +01:00
Alex Waygood
494481a0ae
Improve a bunch of __(deep)copy__ methods ( #7148 )
2022-02-06 15:40:44 -08:00
Alex Waygood
a62fd92fb0
Improve some in-place BinOp methods ( #7149 )
2022-02-06 15:36:57 -08:00
Alex Waygood
348c38a0dd
Improve __all__ definitions for threading and _dummy_threading modules ( #7135 )
2022-02-05 08:07:02 -08:00
Alex Waygood
287c8c3d79
Add __all__ to copyreg stubs ( #7137 )
2022-02-05 07:28:15 -08:00
Alex Waygood
004f12a1eb
Add __all__ to _osx_support ( #7136 )
2022-02-05 07:27:01 -08:00
Alex Waygood
1371a1e1fe
unittest deprecations have been deferred until 3.12 ( #7131 )
...
See https://github.com/python/cpython/pull/30935
2022-02-04 15:52:30 -08:00
Alex Waygood
51cdd2c6be
Backport many Self-related changes to the Python-2 stdlib ( #7128 )
2022-02-04 10:10:05 -08:00
Alex Waygood
26e8959279
Use _typeshed.Self in docutils.VersionInfo and os.sched_param ( #7117 )
2022-02-02 23:30:39 +01:00
Alex Waygood
15d76b072a
Improve classmethods in paramiko stubs ( #7113 )
2022-02-02 22:15:26 +01:00
Alex Waygood
b4e97a1909
Improve __enter__ & constructor methods ( #7114 )
2022-02-02 22:14:59 +01:00
Alex Waygood
7ccbbdb30a
stdlib: Improve many __iter__ and constructor methods ( #7112 )
2022-02-02 19:14:57 +01:00
Alex Waygood and pre-commit-ci[bot]
27c7aece10
Update asyncio.trsock to reflect methods removed in 3.11 ( #7110 )
...
* Update `asyncio.trsock` to reflect methods removed in 3.11
These were all removed in https://bugs.python.org/issue43232
* [pre-commit.ci] auto fixes from pre-commit.com hooks
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-02-02 09:44:26 -08:00
Alex Waygood and Sebastian Rittau
806c26045e
Improve itertools stubs ( #7109 )
...
There are quite a few `__iter__` methods in `itertools` that return `self` at runtime. They should do so in the stubs as well.
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
2022-02-02 08:37:41 -08:00
Alex Waygood
f50255025a
calendar.different_locale.__enter__ returns None, not _LocaleType (#7108 )
2022-02-02 16:28:18 +01:00
Alex Waygood
584336a41e
Fix several methods that should be async def, but aren't ( #7107 )
2022-02-02 15:18:14 +01:00
Alex Waygood
3e6375e606
Delete commented-out pydoc.Scanner class ( #7100 )
2022-02-01 19:46:51 +02:00
Alex Waygood
023e21dedf
Delete SupportsAnyComparison type in _typeshed ( #7098 )
2022-02-01 14:32:20 +01:00
Alex Waygood
f86f096e1c
Use literal types in lzma ( #7095 )
2022-01-31 10:46:26 -08:00
Alex Waygood and Akuli
45a2dad83c
Reduce use of Any in equality methods ( #7081 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-01-30 00:59:00 +02:00
Alex Waygood
d59fb394e7
Remove unused TypeVar ( #7079 )
...
Flagged by https://github.com/PyCQA/flake8-pyi/pull/161
2022-01-29 11:36:02 -08:00
Alex Waygood
99cec2d16b
Reduce duplication of code between typing and typing_extensions ( #7075 )
2022-01-29 07:44:42 -08:00
Alex Waygood
7e79706ddd
Clarify why some module-level objects in typing have default values ( #7037 )
2022-01-28 17:38:25 -08:00
Alex Waygood
33ecb68603
Fix return annotations of several methods that return self at runtime ( #7070 )
2022-01-28 17:37:49 -08:00
Alex Waygood
390634b96b
Improve weakref.WeakValueDictionary.__init__ ( #7068 )
2022-01-28 12:35:26 +01:00
Alex Waygood
dbb5488b31
Do not use True or False as default values in assignments ( #7060 )
2022-01-27 13:51:36 -08:00
Alex Waygood
0e185f4087
Improve inspect stubs ( #7050 )
2022-01-27 09:04:48 -08:00
Alex Waygood
f7a7e0b386
Improve unittest.removeHandler in Python 2 ( #7055 )
...
This brings the signature in line with the signature of `removeHandler` in Python 3:
https://github.com/python/typeshed/blob/a54e21992c26485edb374e1287a7e9c073d6a9ae/stdlib/unittest/signals.pyi#L11-L14
2022-01-27 09:04:18 -08:00
Alex Waygood
2d8decd237
Backport many ParamSpec-related changes to Python 2 ( #7054 )
2022-01-27 07:57:26 -08:00
Alex Waygood
5b39d07cd9
Add ParamSpec to decorator.contextmanager ( #7051 )
...
There may be other places in this package where `ParamSpec` could be used, but this one is the most clear-cut.
2022-01-27 07:35:19 -08:00
Alex Waygood
e01fc81497
Improve contextvars.Context ( #7052 )
...
Similar changes to the ones @sobolevn made in #6942
2022-01-27 07:33:53 -08:00
Alex Waygood
5d07ebc864
Use PEP 585 syntax in typing and typing_extensions, and remove module-level defaults where possible ( #7036 )
2022-01-25 16:13:36 +01:00
Alex Waygood
a9ae6b246c
Remove many checks from check_new_syntax.py ( #7023 )
...
These are now checked by the flake8-pyi plugin, which is better tested and more comprehensive. Removing these checks from `check_new_syntax.py` will reduce the risk of a contributor getting two nearly identical error messages for the same line in a PR.
2022-01-24 07:30:27 -08:00
Alex Waygood
6346464aed
Use import instead of type alias in email/message.pyi ( #7022 )
2022-01-24 13:00:29 +01:00
Alex Waygood
049a260acb
Use class-based syntax for TypedDict in Flask-Cors/flask_cors/core.pyi ( #6995 )
...
Refs https://github.com/PyCQA/flake8-pyi/pull/133
2022-01-22 08:46:15 -08:00
Alex Waygood
d053d8ffea
Make mapping attribute read-only on dict views classes ( #6991 )
2022-01-22 11:49:59 +02:00
Alex Waygood
76af72831a
Use the Literal["foo", "bar"] syntax consistently ( #6984 )
2022-01-20 20:16:04 +02:00
Alex Waygood
bcd9ca47f6
Remove unneeded # noqa comment ( #6979 )
2022-01-20 14:11:23 +01:00
Alex Waygood
aea52b35d1
Remove nearly all __str__ and __repr__ methods from typeshed ( #6968 )
2022-01-20 00:45:11 +01:00
Alex Waygood
fe6233a8c3
Add Y027 to list of ignored .flake8 error codes ( #6962 )
...
Refs https://github.com/PyCQA/flake8-pyi/pull/104
2022-01-19 07:17:30 -08:00
Alex Waygood
2170693e11
Add various __*or__ methods, and improve dict.__ior__ ( #6961 )
2022-01-19 12:24:16 +01:00
Alex Waygood
90d92aa0a5
Use _typeshed.Self in protobuf/google/protobuf/message.pyi ( #6955 )
2022-01-18 12:54:09 -08:00
Alex Waygood
cd93461225
Use PEP 585 syntax in @python2/_ast, convert more TypeVars to _typeshed.Self, & # noqa a SQLAlchemy line ( #6954 )
...
* Manual fixes for `_ast` and `SQLAlchemy`
* Change more `TypeVar`s to `Self`, using script
2022-01-18 11:15:34 -08:00
Alex Waygood
8af5e0d340
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible ( #6949 )
2022-01-18 07:14:03 -08:00
Alex Waygood
1eadf1ab35
Use int | Any for types.FrameType.f_lineno ( #6935 )
2022-01-17 11:32:20 +02:00
Alex Waygood
6a88d5e7ae
Use _typeshed.Self in Python 2, too ( #6932 )
2022-01-16 14:44:51 -08:00
Alex Waygood
425ba77bb2
Remove even more unused TypeVars ( #6928 )
2022-01-16 08:07:32 -08:00
Alex Waygood
dbcb38a605
Add more missing methods to os._Environ ( #6926 )
2022-01-16 06:45:11 -08:00
Alex Waygood and Akuli
af8e37d273
Add # noqa comments to typing.AnyStr ( #6925 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-01-16 14:23:22 +02:00
Alex Waygood
7d33ff330a
Clean up several version-dependent modules ( #6885 )
2022-01-10 05:57:08 -08:00
Alex Waygood
96c9abb058
Always use _typeshed.Self, where applicable ( #6880 )
...
* Always use `_typeshed.Self`, where applicable
* Revert changes to `google-cloud-ndb` (ambiguous)
* Remove empty line added by script
* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`
* Manually add a few more that the script missed
* Improve `filelock` annotation
Source code here: https://github.com/tox-dev/py-filelock/blob/79ec7b2826e33b982fe83b057f359448b9d966ba/src/filelock/_api.py#L207
* Improve `opentracing/scope` annotation
Source code here: https://github.com/opentracing/opentracing-python/blob/3e1d357a348269ef54d67f761302fab93dbfc0f7/opentracing/scope.py#L71
* Improve `redis/client` stub
Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/client.py#L1217
* Improve `redis/lock` annotation
Source code here: https://github.com/redis/redis-py/blob/15f315a496c3267c8cbcc6d6d9c6005ea4d4a4d5/redis/lock.py#L155
* Improve `requests/models` annotation
Source code here: https://github.com/psf/requests/blob/d718e753834b84018014a23d663369ac27d1ab9c/requests/models.py#L653
2022-01-09 19:16:19 -08:00
Alex Waygood
3351f0c0b9
Remove unused requests allowlist entry ( #6882 )
2022-01-10 00:18:23 +01:00
Alex Waygood and pre-commit-ci[bot]
a0b5deda40
All instance attributes on memoryview are read-only ( #6878 )
...
* All instance attributes on `memoryview` are read-only
* [pre-commit.ci] auto fixes from pre-commit.com hooks
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-09 12:07:09 -08:00
Alex Waygood
4e046163b5
Delete many redundant method redefinitions ( #6877 )
2022-01-09 11:21:03 -08:00
Alex Waygood
a40d79a4e6
Use lowercase type everywhere ( #6853 )
2022-01-08 16:09:29 +01:00
Alex Waygood
9558b36a45
range and slice: start, stop, step are read-only ( #6849 )
2022-01-07 19:17:28 +02:00
Alex Waygood
df6f701ba4
builtins: Fix from_bytes() and fromhex() return type ( #6842 )
2022-01-07 00:43:04 +02:00
Alex Waygood
2268955701
Remove several unused TypeVars ( #6829 )
2022-01-05 17:58:03 +02:00
Alex Waygood and Akuli
beedc1d039
Improve sys stubs ( #6816 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-01-05 17:37:40 +02:00
Alex Waygood
6ff9020603
Clean up os.statvfs_result ( #6828 )
2022-01-05 14:53:12 +02:00
Alex Waygood
3112f0e525
_typeshed.structseq: Use Final instead of ClassVar (#6825 )
2022-01-05 14:16:57 +02:00
Alex Waygood
582f1e9c5f
Make os.path.join() first parameter pos-only ( #6812 )
2022-01-04 15:38:46 +01:00
Alex Waygood
e655282e87
sys.version_info is a structseq class (#6786 )
2022-01-02 22:04:27 +02:00