Skip to content

Commit ce69ac8

Browse files
committed
Merge branch 'main' into ci-uv-version
2 parents 509dd5e + 4a8635d commit ce69ac8

12 files changed

Lines changed: 112 additions & 98 deletions

File tree

stdlib/_ctypes.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class _PyCPointerType(_CTypeBaseType):
114114
def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ...
115115
def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ...
116116
def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ...
117-
def set_type(self, type: Any, /) -> None: ...
117+
def set_type(self, type: _CTypeBaseType, /) -> None: ...
118118
if sys.version_info < (3, 13):
119119
# Inherited from CType_Type starting on 3.13
120120
def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues]

stdlib/_sqlite3.pyi

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ from sqlite3 import (
1616
ProgrammingError as ProgrammingError,
1717
Row as Row,
1818
Warning as Warning,
19+
_IsolationLevel,
1920
)
20-
from typing import Any, Final, Literal, TypeVar, overload
21+
from typing import Any, Final, TypeVar, overload
2122
from typing_extensions import TypeAlias
2223

2324
if sys.version_info >= (3, 11):
@@ -225,7 +226,7 @@ if sys.version_info >= (3, 12):
225226
database: StrOrBytesPath,
226227
timeout: float = 5.0,
227228
detect_types: int = 0,
228-
isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED",
229+
isolation_level: _IsolationLevel = "DEFERRED",
229230
check_same_thread: bool = True,
230231
cached_statements: int = 128,
231232
uri: bool = False,
@@ -237,7 +238,7 @@ if sys.version_info >= (3, 12):
237238
database: StrOrBytesPath,
238239
timeout: float,
239240
detect_types: int,
240-
isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None,
241+
isolation_level: _IsolationLevel,
241242
check_same_thread: bool,
242243
factory: type[_ConnectionT],
243244
cached_statements: int = 128,
@@ -250,7 +251,7 @@ if sys.version_info >= (3, 12):
250251
database: StrOrBytesPath,
251252
timeout: float = 5.0,
252253
detect_types: int = 0,
253-
isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED",
254+
isolation_level: _IsolationLevel = "DEFERRED",
254255
check_same_thread: bool = True,
255256
*,
256257
factory: type[_ConnectionT],
@@ -265,7 +266,7 @@ else:
265266
database: StrOrBytesPath,
266267
timeout: float = 5.0,
267268
detect_types: int = 0,
268-
isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED",
269+
isolation_level: _IsolationLevel = "DEFERRED",
269270
check_same_thread: bool = True,
270271
cached_statements: int = 128,
271272
uri: bool = False,
@@ -275,7 +276,7 @@ else:
275276
database: StrOrBytesPath,
276277
timeout: float,
277278
detect_types: int,
278-
isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None,
279+
isolation_level: _IsolationLevel,
279280
check_same_thread: bool,
280281
factory: type[_ConnectionT],
281282
cached_statements: int = 128,
@@ -286,7 +287,7 @@ else:
286287
database: StrOrBytesPath,
287288
timeout: float = 5.0,
288289
detect_types: int = 0,
289-
isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED",
290+
isolation_level: _IsolationLevel = "DEFERRED",
290291
check_same_thread: bool = True,
291292
*,
292293
factory: type[_ConnectionT],

stdlib/_thread.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def start_new(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]
7373
def start_new(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ...
7474

7575
if sys.version_info >= (3, 10):
76-
def interrupt_main(signum: signal.Signals = ..., /) -> None: ...
76+
def interrupt_main(signum: signal.Signals = signal.SIGINT, /) -> None: ...
7777

7878
else:
7979
def interrupt_main() -> None: ...

stdlib/configparser.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,17 @@ class SectionProxy(MutableMapping[str, str]):
369369
# These are partially-applied version of the methods with the same names in
370370
# RawConfigParser; the stubs should be kept updated together
371371
@overload
372-
def getint(self, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> int | None: ...
372+
def getint(self, option: str, *, raw: bool = False, vars: _Section | None = None) -> int | None: ...
373373
@overload
374-
def getint(self, option: str, fallback: _T = ..., *, raw: bool = ..., vars: _Section | None = ...) -> int | _T: ...
374+
def getint(self, option: str, fallback: _T = ..., *, raw: bool = False, vars: _Section | None = None) -> int | _T: ...
375375
@overload
376-
def getfloat(self, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> float | None: ...
376+
def getfloat(self, option: str, *, raw: bool = False, vars: _Section | None = None) -> float | None: ...
377377
@overload
378-
def getfloat(self, option: str, fallback: _T = ..., *, raw: bool = ..., vars: _Section | None = ...) -> float | _T: ...
378+
def getfloat(self, option: str, fallback: _T = ..., *, raw: bool = False, vars: _Section | None = None) -> float | _T: ...
379379
@overload
380-
def getboolean(self, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> bool | None: ...
380+
def getboolean(self, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool | None: ...
381381
@overload
382-
def getboolean(self, option: str, fallback: _T = ..., *, raw: bool = ..., vars: _Section | None = ...) -> bool | _T: ...
382+
def getboolean(self, option: str, fallback: _T = ..., *, raw: bool = False, vars: _Section | None = None) -> bool | _T: ...
383383
# SectionProxy can have arbitrary attributes when custom converters are used
384384
def __getattr__(self, key: str) -> Callable[..., Any]: ...
385385

stdlib/ctypes/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ from _ctypes import (
1111
_CData as _CData,
1212
_CDataType as _CDataType,
1313
_CField as _CField,
14+
_CTypeBaseType,
1415
_Pointer as _Pointer,
1516
_PointerLike as _PointerLike,
1617
_SimpleCData as _SimpleCData,
@@ -162,7 +163,7 @@ c_buffer = create_string_buffer
162163

163164
def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...
164165
@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15")
165-
def SetPointerType(pointer: type[_Pointer[Any]], cls: Any) -> None: ...
166+
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
166167
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... # Soft Deprecated, no plans to remove
167168

168169
if sys.platform == "win32":

stdlib/datetime.pyi

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ class time:
118118
resolution: ClassVar[timedelta]
119119
def __new__(
120120
cls,
121-
hour: SupportsIndex = ...,
122-
minute: SupportsIndex = ...,
123-
second: SupportsIndex = ...,
124-
microsecond: SupportsIndex = ...,
125-
tzinfo: _TzInfo | None = ...,
121+
hour: SupportsIndex = 0,
122+
minute: SupportsIndex = 0,
123+
second: SupportsIndex = 0,
124+
microsecond: SupportsIndex = 0,
125+
tzinfo: _TzInfo | None = None,
126126
*,
127-
fold: int = ...,
127+
fold: int = 0,
128128
) -> Self: ...
129129
@property
130130
def hour(self) -> int: ...
@@ -144,7 +144,7 @@ class time:
144144
def __gt__(self, value: time, /) -> bool: ...
145145
def __eq__(self, value: object, /) -> bool: ...
146146
def __hash__(self) -> int: ...
147-
def isoformat(self, timespec: str = ...) -> str: ...
147+
def isoformat(self, timespec: str = "auto") -> str: ...
148148
@classmethod
149149
def fromisoformat(cls, time_string: str, /) -> Self: ...
150150

@@ -197,13 +197,13 @@ class timedelta:
197197
resolution: ClassVar[timedelta]
198198
def __new__(
199199
cls,
200-
days: float = ...,
201-
seconds: float = ...,
202-
microseconds: float = ...,
203-
milliseconds: float = ...,
204-
minutes: float = ...,
205-
hours: float = ...,
206-
weeks: float = ...,
200+
days: float = 0,
201+
seconds: float = 0,
202+
microseconds: float = 0,
203+
milliseconds: float = 0,
204+
minutes: float = 0,
205+
hours: float = 0,
206+
weeks: float = 0,
207207
) -> Self: ...
208208
@property
209209
def days(self) -> int: ...
@@ -247,13 +247,13 @@ class datetime(date):
247247
year: SupportsIndex,
248248
month: SupportsIndex,
249249
day: SupportsIndex,
250-
hour: SupportsIndex = ...,
251-
minute: SupportsIndex = ...,
252-
second: SupportsIndex = ...,
253-
microsecond: SupportsIndex = ...,
254-
tzinfo: _TzInfo | None = ...,
250+
hour: SupportsIndex = 0,
251+
minute: SupportsIndex = 0,
252+
second: SupportsIndex = 0,
253+
microsecond: SupportsIndex = 0,
254+
tzinfo: _TzInfo | None = None,
255255
*,
256-
fold: int = ...,
256+
fold: int = 0,
257257
) -> Self: ...
258258
@property
259259
def hour(self) -> int: ...
@@ -272,10 +272,10 @@ class datetime(date):
272272
# meaning it is only *safe* to pass it as a keyword argument on 3.12+
273273
if sys.version_info >= (3, 12):
274274
@classmethod
275-
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ...
275+
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = None) -> Self: ...
276276
else:
277277
@classmethod
278-
def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = ...) -> Self: ...
278+
def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = None) -> Self: ...
279279

280280
@classmethod
281281
@deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)")
@@ -321,8 +321,8 @@ class datetime(date):
321321
*,
322322
fold: int = ...,
323323
) -> Self: ...
324-
def astimezone(self, tz: _TzInfo | None = ...) -> Self: ...
325-
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
324+
def astimezone(self, tz: _TzInfo | None = None) -> Self: ...
325+
def isoformat(self, sep: str = "T", timespec: str = "auto") -> str: ...
326326
@classmethod
327327
def strptime(cls, date_string: str, format: str, /) -> Self: ...
328328
def utcoffset(self) -> timedelta | None: ...

stdlib/ipaddress.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class IPv4Address(_BaseV4, _BaseAddress):
137137
def ipv6_mapped(self) -> IPv6Address: ...
138138

139139
class IPv4Network(_BaseV4, _BaseNetwork[IPv4Address]):
140-
def __init__(self, address: object, strict: bool = ...) -> None: ...
140+
def __init__(self, address: object, strict: bool = True) -> None: ...
141141

142142
class IPv4Interface(IPv4Address):
143143
netmask: IPv4Address
@@ -197,7 +197,7 @@ class IPv6Address(_BaseV6, _BaseAddress):
197197
def __eq__(self, other: object) -> bool: ...
198198

199199
class IPv6Network(_BaseV6, _BaseNetwork[IPv6Address]):
200-
def __init__(self, address: object, strict: bool = ...) -> None: ...
200+
def __init__(self, address: object, strict: bool = True) -> None: ...
201201
@property
202202
def is_site_local(self) -> bool: ...
203203

stdlib/pprint.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ else:
2929
if sys.version_info >= (3, 10):
3030
def pp(
3131
object: object,
32-
stream: IO[str] | None = ...,
33-
indent: int = ...,
34-
width: int = ...,
35-
depth: int | None = ...,
32+
stream: IO[str] | None = None,
33+
indent: int = 1,
34+
width: int = 80,
35+
depth: int | None = None,
3636
*,
37-
compact: bool = ...,
37+
compact: bool = False,
3838
sort_dicts: bool = False,
39-
underscore_numbers: bool = ...,
39+
underscore_numbers: bool = False,
4040
) -> None: ...
4141

4242
else:
4343
def pp(
4444
object: object,
45-
stream: IO[str] | None = ...,
46-
indent: int = ...,
47-
width: int = ...,
48-
depth: int | None = ...,
45+
stream: IO[str] | None = None,
46+
indent: int = 1,
47+
width: int = 80,
48+
depth: int | None = None,
4949
*,
50-
compact: bool = ...,
50+
compact: bool = False,
5151
sort_dicts: bool = False,
5252
) -> None: ...
5353

stdlib/sqlite3/__init__.pyi

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ _SqliteData: TypeAlias = str | ReadableBuffer | int | float | None
220220
_AdaptedInputData: TypeAlias = _SqliteData | Any
221221
# The Mapping must really be a dict, but making it invariant is too annoying.
222222
_Parameters: TypeAlias = SupportsLenAndGetItem[_AdaptedInputData] | Mapping[str, _AdaptedInputData]
223+
# Controls the legacy transaction handling mode of sqlite3.
224+
_IsolationLevel: TypeAlias = Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None
223225

224226
class _AnyParamWindowAggregateClass(Protocol):
225227
def step(self, *args: Any) -> object: ...
@@ -285,7 +287,7 @@ class Connection:
285287
def Warning(self) -> type[Warning]: ...
286288
@property
287289
def in_transaction(self) -> bool: ...
288-
isolation_level: str | None # one of '', 'DEFERRED', 'IMMEDIATE' or 'EXCLUSIVE'
290+
isolation_level: _IsolationLevel
289291
@property
290292
def total_changes(self) -> int: ...
291293
if sys.version_info >= (3, 12):
@@ -299,26 +301,26 @@ class Connection:
299301
def __init__(
300302
self,
301303
database: StrOrBytesPath,
302-
timeout: float = ...,
303-
detect_types: int = ...,
304-
isolation_level: str | None = ...,
305-
check_same_thread: bool = ...,
304+
timeout: float = 5.0,
305+
detect_types: int = 0,
306+
isolation_level: _IsolationLevel = "DEFERRED",
307+
check_same_thread: bool = True,
306308
factory: type[Connection] | None = ...,
307-
cached_statements: int = ...,
308-
uri: bool = ...,
309+
cached_statements: int = 128,
310+
uri: bool = False,
309311
autocommit: bool = ...,
310312
) -> None: ...
311313
else:
312314
def __init__(
313315
self,
314316
database: StrOrBytesPath,
315-
timeout: float = ...,
316-
detect_types: int = ...,
317-
isolation_level: str | None = ...,
318-
check_same_thread: bool = ...,
317+
timeout: float = 5.0,
318+
detect_types: int = 0,
319+
isolation_level: _IsolationLevel = "DEFERRED",
320+
check_same_thread: bool = True,
319321
factory: type[Connection] | None = ...,
320-
cached_statements: int = ...,
321-
uri: bool = ...,
322+
cached_statements: int = 128,
323+
uri: bool = False,
322324
) -> None: ...
323325

324326
def close(self) -> None: ...

stdlib/threading.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class Condition:
142142
def __exit__(
143143
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
144144
) -> None: ...
145-
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
145+
def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ...
146146
def release(self) -> None: ...
147147
def wait(self, timeout: float | None = None) -> bool: ...
148148
def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ...

0 commit comments

Comments
 (0)