Fix various argument of extension modules (#13651)

* Mark various positional-only arguments: These are all positional-only
  arguments in C code using the `METH_O` flag.
* Remove various `*args, **kwargs` arguments that are using the
  `METH_NOARGS` flag in C.
This commit is contained in:
Sebastian Rittau
2025-03-18 02:22:34 +01:00
committed by GitHub
parent 089bbcb39e
commit b93eae52af
5 changed files with 37 additions and 37 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ class Cursor:
def prepare(self, operation: str, newcursor: Literal[True]) -> Cursor: ...
@overload
def prepare(self, operation: str, newcursor: Literal[False]) -> Any: ...
def print_message(self, *args, **kwargs): ...
def print_message(self): ...
def parsenamedquery(self, *args, **kwargs): ...
def scroll(self, value: int, mode: Literal["absolute", "relative"] = ...) -> None: ...
def server_cpu_time(self) -> int: ...
+32 -32
View File
@@ -24,46 +24,46 @@ class connection:
port: Incomplete
server_capabilities: Incomplete
def __init__(self, *args, **kwargs) -> None: ...
def _get_native_connection(self, *args, **kwargs): ...
def affected_rows(self, *args, **kwargs): ...
def _get_native_connection(self): ...
def affected_rows(self): ...
def autocommit(self, on): ...
def change_user(self, *args, **kwargs): ...
def character_set_name(self, *args, **kwargs): ...
def close(self, *args, **kwargs): ...
def commit(self, *args, **kwargs): ...
def dump_debug_info(self, *args, **kwargs): ...
def errno(self, *args, **kwargs): ...
def error(self, *args, **kwargs): ...
def character_set_name(self): ...
def close(self): ...
def commit(self): ...
def dump_debug_info(self): ...
def errno(self): ...
def error(self): ...
def escape(self, obj, dict): ...
def escape_string(self, s): ...
def field_count(self, *args, **kwargs): ...
def fileno(self, *args, **kwargs): ...
def get_autocommit(self, *args, **kwargs): ...
def get_character_set_info(self, *args, **kwargs): ...
def get_host_info(self, *args, **kwargs): ...
def get_proto_info(self, *args, **kwargs): ...
def get_server_info(self, *args, **kwargs): ...
def info(self, *args, **kwargs): ...
def insert_id(self, *args, **kwargs): ...
def field_count(self): ...
def fileno(self): ...
def get_autocommit(self): ...
def get_character_set_info(self): ...
def get_host_info(self): ...
def get_proto_info(self): ...
def get_server_info(self): ...
def info(self): ...
def insert_id(self): ...
def kill(self, *args, **kwargs): ...
def next_result(self): ...
def ping(self): ...
def query(self, query): ...
def read_query_result(self, *args, **kwargs): ...
def rollback(self, *args, **kwargs): ...
def read_query_result(self): ...
def rollback(self): ...
def select_db(self, *args, **kwargs): ...
def send_query(self, *args, **kwargs): ...
def set_character_set(self, charset: str) -> None: ...
def set_server_option(self, option): ...
def shutdown(self, *args, **kwargs): ...
def sqlstate(self, *args, **kwargs): ...
def stat(self, *args, **kwargs): ...
def store_result(self, *args, **kwargs): ...
def string_literal(self, obj): ...
def thread_id(self, *args, **kwargs): ...
def use_result(self, *args, **kwargs): ...
def shutdown(self): ...
def sqlstate(self): ...
def stat(self): ...
def store_result(self): ...
def string_literal(self, obj, /) -> str: ...
def thread_id(self): ...
def use_result(self): ...
def discard_result(self) -> None: ...
def warning_count(self, *args, **kwargs): ...
def warning_count(self): ...
def __delattr__(self, name: str, /) -> None: ...
def __setattr__(self, name: str, value, /) -> None: ...
@@ -72,12 +72,12 @@ class result:
has_next: Incomplete
def __init__(self, *args, **kwargs) -> None: ...
def data_seek(self, n): ...
def describe(self, *args, **kwargs): ...
def describe(self): ...
def fetch_row(self, *args, **kwargs): ...
def discard(self) -> None: ...
def field_flags(self, *args, **kwargs): ...
def num_fields(self, *args, **kwargs): ...
def num_rows(self, *args, **kwargs): ...
def field_flags(self): ...
def num_fields(self): ...
def num_rows(self): ...
def __delattr__(self, name: str, /) -> None: ...
def __setattr__(self, name: str, value, /) -> None: ...
@@ -86,4 +86,4 @@ def debug(*args, **kwargs): ...
def escape(obj, dict): ...
def escape_string(s): ...
def get_client_info(): ...
def string_literal(obj): ...
def string_literal(obj, /) -> str: ...
+1 -1
View File
@@ -378,7 +378,7 @@ class ReplicationCursor(cursor):
wal_end: Any
def __init__(self, *args, **kwargs) -> None: ...
def consume_stream(self, consumer, keepalive_interval=...): ...
def read_message(self, *args, **kwargs): ...
def read_message(self) -> Incomplete | None: ...
def send_feedback(self, write_lsn=..., flush_lsn=..., apply_lsn=..., reply=..., force=...): ...
def start_replication_expert(self, command, decode=..., status_interval=...): ...
+2 -2
View File
@@ -632,8 +632,8 @@ class Match(Generic[AnyStr]):
def ends(self, group: int | str = ..., /) -> list[int]: ...
@overload
def ends(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[int], ...]: ...
def expand(self, template: AnyStr) -> AnyStr: ...
def expandf(self, format: AnyStr) -> AnyStr: ...
def expand(self, template: AnyStr, /) -> AnyStr: ...
def expandf(self, format: AnyStr, /) -> AnyStr: ...
@overload
def captures(self, group: int | str = ..., /) -> list[AnyStr]: ...
@overload
+1 -1
View File
@@ -57,4 +57,4 @@ class JSONEncoder:
class JSONEncoderForHTML(JSONEncoder): ...
def encode_basestring(s: str | bytes, _PY3: Literal[True] = ..., _q: str = ...) -> str: ...
def encode_basestring_ascii(s: str | bytes, _PY3: Literal[True] = ...) -> str: ...
def encode_basestring_ascii(s: str | bytes, /) -> str: ...