Commit Graph

5274 Commits

Author SHA1 Message Date
Randolf Scholz
601587e71d changed overload order for date.__sub__ and datetime.__sub__ (#10999) 2024-02-19 13:11:29 +01:00
Sebastian Rittau
df409a2fb5 Use a protocol for shlex.instream et al. (#11452) 2024-02-18 22:04:43 -08:00
Avasam
bb6613f379 shlex.split: allow TextIO and deprecate None (#11451) 2024-02-19 06:10:01 +01:00
Jelle Zijlstra
84572bbfe6 importlib.metadata: Use the SimplePath protocol (#11445)
Closes #9217. Followup from #11436.

This mostly makes a simpler set of changes than #9217; in particular
it does not make PathDistribution generic. I think this is in line with
how the protocol is supposed to be used, though not always in line with
the runtime type annotations (which don't all make sense).

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2024-02-18 21:05:33 -08:00
Ali Hamdan
6df52a7b39 Improve typing of start_new_thread when called without kwargs (#11446) 2024-02-19 05:39:18 +01:00
Jelle Zijlstra
bba8cbd6f8 stdlib: more deprecations (#11009)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-18 06:50:29 -08:00
Jelle Zijlstra
705744af4c Update for typing_extensions 4.10 (#11438) 2024-02-18 00:59:48 -08:00
Jelle Zijlstra
e5d25a7605 importlib.metadata: Improve and test SimplePath protocol (#11436)
Co-authored-by: layday <layday@protonmail.com>
2024-02-18 00:36:01 -08:00
Nikita Sobolev
e961db9492 Change the asyncio.Task constructor type (#10228) 2024-02-17 15:50:26 -08:00
Nikita Sobolev
863d22a239 Make return type of functools.cache_property covariant (#10053)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-17 15:38:46 -08:00
Akuli
d5ff34e049 Add types to tkinter.Canvas.scale() (#11369) 2024-02-16 21:10:14 -08:00
Stephen Morton
764532356a add _lsprof module (#11159)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-16 08:38:49 -08:00
winestone
f3c7c48438 itertools: Improve precision of itertools.product types when called with 7 or more arguments (#11163) 2024-02-16 07:03:13 -08:00
plokmijnuhby
c5c2c14db9 builtins: Fix typing of reversed (#10655) 2024-02-16 06:52:58 -08:00
Alex Waygood
7c3cb9971d Further improve return types in the numbers module (#11375) 2024-02-15 21:04:25 -08:00
Sebastian Rittau
4664986cea Turn TextIOWrapper(buffer) into a protocol (#11420) 2024-02-14 19:49:28 +01:00
Watal M. Iwasaki
a3d356c04c ftplib: Correct timeout option to float | None (#11419) 2024-02-14 10:25:48 +00:00
Akuli
41245698e0 Delete a few simple type aliases in tkinter (#11415) 2024-02-13 11:37:32 +01:00
Akuli
b44d22e81d Use bool | Literal[0, 1] instead of int in some tkinter bool parameters (#11412)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-13 02:06:00 +02:00
Riley Miļeško
5382d24d1d Fix return type of calendar.HTMLCalendar.formatyearpage (#11413) 2024-02-12 22:50:32 +00:00
Marcell Perger
4585c714d9 Add annotations and defaults for tkinter.ttk.OptionMenu (#11404)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2024-02-12 21:33:42 +02:00
Marcell Perger
13aed8a1c2 Add defaults for tkinter.ttk __init__ methods (#11405)
NOTE: I've ignored things marked as undocumented or where the type of the default didn't match the annotation.
2024-02-12 12:54:12 +02:00
Marcell Perger
49d5827141 Add annotations for tkinter.ttk.LabeledScale (#11402) 2024-02-11 20:05:27 +02:00
Mike Zimin
a773d3f6e7 unicodedata.pyi: Add normalization form literal (#11390) 2024-02-11 16:20:52 +01:00
Marcell Perger
5eb040b1e6 Fix tkinter.ttk's compound argument (#11393)
Allow the empty string (`""`).
2024-02-10 20:55:08 +02:00
Marcell Perger
187928d8ce Add defaults for tkinter __init__ methods (#11391)
Add defaults for `tkinter`'s `__init__` methods, see #10947 

Some notes about specific arguments:
- `variable` and `textvariable`: The default value (using `dict`) is consistently `""` but this doesn't match the annotated `Variable` type so I didn't fill these in
- `Message(padx, pady)`: The default value is `-1` which is not allowed according to the documentation so I didn't fill this in
- `Toplevel(use)`: The default value is always `""` but this doesn't match the annotated `int` type so I didn't fill this in
2024-02-10 20:51:27 +02:00
Alex Waygood
15cdc20744 Fix stdlib stubtest for Python 3.11.8 and 3.12.2 (#11384)
Fix stubtest for Python 3.11.8 and 3.12.2
2024-02-09 02:28:03 -08:00
Ran Benita
a4f81a67a0 sys: add last_exc on Python>=3.12 (#11378)
https://docs.python.org/3/library/sys.html#sys.last_exc
2024-02-07 20:37:48 +00:00
M Bussonnier
edf41ae5e2 Update type of Formatter.convert_field (missing |None) (#11377)
From the source it expects that the second parameter (conversion), can
be None:

```python
   def convert_field(self, value, conversion):
        # do any conversion on the resulting object
        if conversion is None:
            return value
   ...
```

Since at least 17 years according to git blame, as None is refered as
early as 11529195cae2438a3ac003babcb1b11af67c4037
And still present in main branch:

ef3ceab09d/Lib/string.py
2024-02-07 19:24:21 +00:00
Akuli
e6e2f22e6c Annotate tkinter.Canvas.type() (#11366) 2024-02-06 07:31:59 +01:00
Takumasa N
f11eb92bf4 subprocess: Use _CMD instead of str | bytes in getstatusoutput and getoutput (#11354) 2024-02-05 05:36:55 -08:00
Marcell Perger
2c29505765 Fix tkinter overrelief argument (#11360) 2024-02-05 14:40:22 +02:00
Alex Waygood
a2a6aee892 Fix annotation for ast.alias.name (#11364)
This isn't necessarily always an identifier:

```pycon
>>> print(ast.dump(ast.parse('from typing import *'), indent=2))
Module(
  body=[
    ImportFrom(
      module='typing',
      names=[
        alias(name='*')],
      level=0)],
  type_ignores=[])
>>> '*'.isidentifier()
False
```
2024-02-05 01:42:20 +00:00
Alex Waygood
c49c84f319 A new shade of Black (#11362) 2024-02-04 16:38:55 -08:00
Alex Waygood
4d8ee113fb Add more return types to the numbers module (#11353) 2024-02-01 18:12:41 +00:00
Stephen Morton
9877ed8092 Various ctypes improvements (#11186)
Mostly more attention paid to which classes are actually the same class
2024-01-30 22:18:00 -08:00
Christoph Tyralla
1ce82b8d3e Generalise attribute __func__ of class MethodType from FunctionType to Callable (#11201)
Let property `__func__` of class `MethodType` return `Callable[..., Any]` instead of `_StaticFunctionType` and remove the latter.

Co-authored-by: Tyralla <tyralla@bce01.de>
2024-01-30 20:22:52 -08:00
Shantanu
21f84d09c3 concurrent.futures: allow as_completed to act covariantly (#11291) 2024-01-30 20:14:29 -08:00
Sebastian Rittau
8e872a022c numbers: Remove Any annotations (#11347) 2024-01-30 15:17:06 +01:00
Shantanu
9d445b0eef Move resource.struct_rusage import (#11343) 2024-01-30 00:52:05 -08:00
Avasam
81070c4dbc posixpath.commonpath supports Iterable parameter (#11310) 2024-01-29 13:13:34 +01:00
Andrew
6d9f28a7ca http.serverBaseHTTPRequestHandler.date_time_string: timestamp is a float (#11322) 2024-01-27 12:29:24 +01:00
Oleg A
b4f60ac5bf asyncio: Correct _waiters type (#11315) 2024-01-25 20:24:54 +01:00
shz42
2168ab5ff4 Add tuple key type for memoryview.__getitem__ and __setitem__ (#11296) 2024-01-21 05:14:34 +01:00
Akuli
02e19d6e2d tkinter: font size must be integer (#11295) 2024-01-21 02:10:29 +01:00
Karim Baidar
cfb16543b8 Implement Preset Argument in tarfile.open Function and Add Test Coverage (#11251) 2024-01-15 16:39:31 +01:00
AN Long
5367bab4ed Add aware_datetime option to plistlib functions (#11276) 2024-01-15 12:35:43 +01:00
Marcell Perger
673c3c37fe Fix types for setuptools._distutils.ccompiler.CCompiler.compile (#11275) 2024-01-14 14:04:38 +01:00
Ali Hamdan
ae9a68a86e All functions parameters in time module are positional-only (#11248) 2024-01-14 13:52:54 +01:00
Romain d'Esparbès
db804846a4 Fix "state" type annotations for tkinter "Canvas.create_*" methods (#11257) 2024-01-08 18:53:18 +02:00