Commit Graph

5858 Commits

Author SHA1 Message Date
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
Shantanu a6d9b83263 Add @final to several more stdlib classes (#7215)
Co-authored-by: hauntsaninja <>
2022-02-14 15:12:40 -08: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
Nikita Sobolev 4293ad0483 optparse.check_choice returns value type (#7209) 2022-02-14 14:14:03 -08:00
Alex Waygood a8141e14ae Add itertools.repeat.__length_hint__ method (#7212) 2022-02-14 14:13:13 -08:00
Alex Waygood 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
Nikita Sobolev f03d385012 ossaudiodev is not available on windows and darwin (#7204) 2022-02-14 22:02:38 +01: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
Jelle Zijlstra 319d23a16e Add PEP 646 and 675 to typing-extensions (#7198) 2022-02-14 08:59:11 +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
aimileus 5081f684c0 Fix argument types of pytz.tzinfo.StaticTzInfo (#7184)
The argument is_dst of the functions StaticTzInfo.localize and
StaticTzInfo.normalize are ignored, and only present for compatibility with
DstTzInfo. The functions in DstTzInfo also accepts None, so for compatibility,
StaticTzInfo should accept them as well.

[^1] https://github.com/stub42/pytz/blob/2ed682a7c4079042f50975970fc4f503c8450058/src/pytz/tzinfo.py#L112
2022-02-13 07:21:30 -08:00
Nikita Sobolev 5014f9f50c Improve __reduce__ signature accross stdlib (#7182) 2022-02-13 12:24:27 +01:00
Nikita Sobolev 6882e513c2 Improve Self type usage accross stdlib (#7183) 2022-02-13 12:21:01 +01:00
Alex Waygood 03dbe2206c Improve pathlib stubs (#7181) 2022-02-12 18:42:04 -08:00
Nikita Sobolev 2ce1844905 Fix context type in pprint.PrettyPrinter.format (#7179)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-12 11:51:29 -08:00
Nikita Sobolev 3b05794ba9 Improve poplib with Literal values (#7180) 2022-02-12 19:24:18 +02:00
Shantanu 3a2ce92d32 singledispatch: fix lint (#7178)
Co-authored-by: hauntsaninja <>
2022-02-11 17:53:01 -08:00
Sebastian Rittau 92685d18f7 Update to Python 3.9.10 and 3.10.2 (#6977) 2022-02-11 17:37:31 -08:00
James Morris 7e5f3c38bd Add singledispatchmethod to singledispatch (#6089) 2022-02-11 17:23:49 -08:00
Nikita Sobolev 418574f82c Improve socketserver (#7073)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-02-11 17:22:00 -08:00
Luna Nova 846c2dfa4f Add locale.gettext and related stubs, fixes #7164 (#7165) 2022-02-11 17:18:45 -08:00
Ilya Kulakov d014533f36 bisect: elements of a are bounded by SupportsRichComparison (#7111) 2022-02-11 17:12:00 -08:00
Sebastian Rittau 84b5e73396 protobuf doesn't support Python 2 anymore (#7176)
Remove Python-2-only package "futures"
2022-02-11 08:10:31 -08:00
Nikita Sobolev 9150db52a6 Improve pstats typing (#7174)
* Add __all__
* Use Literal for Stats.sort_stats() argument type.
* Add FunctionProfile, StatsProfile, and Stats.get_stats_profile() (Python 3.9+)
2022-02-11 12:30:00 +01:00
Alex Waygood da7604a968 Add stubs for pyflakes (#7175) 2022-02-11 12:21:28 +01:00
Sebastian Rittau 97a327b984 fpdf2: Correct annotations of @contextmanager methods (#7172) 2022-02-10 18:15:09 +01:00
Fares Ahmed 7efda0f21a Improve toml typings (#7146)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-02-10 17:55:31 +02:00
DataGhost 7bb6ce7083 Added missing import for JSONDecodeError (#7171)
Co-authored-by: DataGhost <git@dataghost.com>
2022-02-09 11:31:55 -08:00
Jelle Zijlstra 7dd2485269 New additions to typing, typing_extensions (#7169) 2022-02-08 22:40:09 -08:00
Nikita Sobolev b0202f71eb Update actions/github-script to v5 (#7151) 2022-02-08 14:09:36 -08:00
Dmitry Volodin be5a109c03 Fix zero exponent for ints (#7163) 2022-02-08 14:08:00 -08: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