fix the __init__ of several C-classes (#13211)

This commit is contained in:
Stephen Morton
2024-12-23 10:55:51 -08:00
committed by GitHub
parent bfb9a91950
commit 17408ee538
23 changed files with 160 additions and 111 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
from collections.abc import Callable
from typing import Any, final
from typing_extensions import Self
@final
class make_encoder:
@@ -19,8 +20,8 @@ class make_encoder:
def encoder(self) -> Callable[[str], str]: ...
@property
def item_separator(self) -> str: ...
def __init__(
self,
def __new__(
cls,
markers: dict[int, Any] | None,
default: Callable[[Any], Any],
encoder: Callable[[str], str],
@@ -30,7 +31,7 @@ class make_encoder:
sort_keys: bool,
skipkeys: bool,
allow_nan: bool,
) -> None: ...
) -> Self: ...
def __call__(self, obj: object, _current_indent_level: int) -> Any: ...
@final
@@ -42,7 +43,7 @@ class make_scanner:
parse_float: Any
strict: bool
# TODO: 'context' needs the attrs above (ducktype), but not __call__.
def __init__(self, context: make_scanner) -> None: ...
def __new__(cls, context: make_scanner) -> Self: ...
def __call__(self, string: str, index: int) -> tuple[Any, int]: ...
def encode_basestring(s: str, /) -> str: ...