-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Checklist
- I am confident this is a bug in CPython, not a bug in a third-party project
- I have searched the CPython issue tracker,
and am confident this bug has not been reported before
CPython versions tested on:
3.11, CPython main branch
Operating systems tested on:
Linux, macOS, Windows
Output from running 'python -VV' on the command line:
Python 3.11.4 (main, Jun 20 2023, 17:23:00) [Clang 14.0.3 (clang-1403.0.22.14.1)]
A clear and concise description of the bug:
The method parameters in python are part of the public interface, due to kwargs.
From typing.IO: undocumented / source
def read(self, n: int = -1) -> AnyStr:
passFrom io.RawIOBase: docs / source
def read(self, size=-1):
...If I implement both IO[bytes] and RawIOBase, should name the variable n or size?
Additionally, RawIOBase.read checks for null, so should the type hint be Optional[int]?
Linked PRs
mxmlnkn
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error