Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stdlib/_zstd.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class ZstdCompressor:
CONTINUE: Final = 0
FLUSH_BLOCK: Final = 1
FLUSH_FRAME: Final = 2
def __init__(
def __new__(
self, level: int | None = None, options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | None = None
) -> None: ...
) -> Self: ...
def compress(
self, /, data: ReadableBuffer, mode: _ZstdCompressorContinue | _ZstdCompressorFlushBlock | _ZstdCompressorFlushFrame = 0
) -> bytes: ...
Expand All @@ -58,7 +58,7 @@ class ZstdCompressor:

@final
class ZstdDecompressor:
def __init__(self, zstd_dict: ZstdDict | None = None, options: Mapping[int, int] | None = None) -> None: ...
def __new__(self, zstd_dict: ZstdDict | None = None, options: Mapping[int, int] | None = None) -> Self: ...
def decompress(self, /, data: ReadableBuffer, max_length: int = -1) -> bytes: ...
@property
def eof(self) -> bool: ...
Expand All @@ -69,7 +69,7 @@ class ZstdDecompressor:

@final
class ZstdDict:
def __init__(self, dict_content: bytes, /, *, is_raw: bool = False) -> None: ...
def __new__(self, dict_content: bytes, /, *, is_raw: bool = False) -> Self: ...
def __len__(self, /) -> int: ...
@property
def as_digested_dict(self) -> tuple[Self, int]: ...
Expand Down
15 changes: 11 additions & 4 deletions stdlib/functools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,17 @@ class partialmethod(Generic[_T]):
func: Callable[..., _T] | _Descriptor
args: tuple[Any, ...]
keywords: dict[str, Any]
@overload
def __init__(self, func: Callable[..., _T], /, *args: Any, **keywords: Any) -> None: ...
@overload
def __init__(self, func: _Descriptor, /, *args: Any, **keywords: Any) -> None: ...
if sys.version_info >= (3, 14):
@overload
def __new__(self, func: Callable[..., _T], /, *args: Any, **keywords: Any) -> Self: ...
@overload
def __new__(self, func: _Descriptor, /, *args: Any, **keywords: Any) -> Self: ...
else:
@overload
def __init__(self, func: Callable[..., _T], /, *args: Any, **keywords: Any) -> None: ...
@overload
def __init__(self, func: _Descriptor, /, *args: Any, **keywords: Any) -> None: ...
Comment on lines +172 to +181
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like functools.partial has __new__ rather than __init__ on Python 3.13 too?

Python 3.13.1 (main, Jan  3 2025, 12:04:03) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> functools.partial.__new__
<built-in method __new__ of type object at 0x11d890810>
>>> functools.partial.__init__
<slot wrapper '__init__' of 'object' objects>
>>> functools.partial.__init__ is object.__init__
True
>>> functools.partial.__new__ is object.__new__
False

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is partialmethod, not partial.

Python 3.13.6 (main, Aug  6 2025, 22:48:48) [Clang 20.1.4 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> functools.partialmethod.__new__
<built-in method __new__ of type object at 0x1049a3b58>
>>> functools.partialmethod.__init__
<function partialmethod.__init__ at 0x1026911c0>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, sorry for misreading!


def __get__(self, obj: Any, cls: type[Any] | None = None) -> Callable[..., _T]: ...
@property
def __isabstractmethod__(self) -> bool: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/mmap.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PAGESIZE: Final[int]

class mmap:
if sys.platform == "win32":
def __init__(self, fileno: int, length: int, tagname: str | None = None, access: int = 0, offset: int = 0) -> None: ...
def __new__(self, fileno: int, length: int, tagname: str | None = None, access: int = 0, offset: int = 0) -> Self: ...
else:
if sys.version_info >= (3, 13):
def __new__(
Expand Down
Loading