From 19d1b686b6dfffa7acbda7cbc24bda4e27a96579 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 29 Feb 2024 10:37:12 +0300 Subject: [PATCH] `str.count` only takes positional args (#11503) ``` >>> ''.count(x='a') Traceback (most recent call last): File "", line 1, in TypeError: str.count() takes no keyword arguments ``` --- stdlib/builtins.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 73e75dc34..9bb38b8cd 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -447,7 +447,7 @@ class str(Sequence[str]): def center(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ... @overload def center(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc] - def count(self, x: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... + def count(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... def endswith( self, __suffix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...