Skip to content

Shouldn't FileIO indicate None as possible return of read/write? #12684

Closed
@dcolascione

Description

@dcolascione

Typeshed currently has these declarations in io.pyi for FileIO.

    def write(self, b: ReadableBuffer, /) -> int: ...
    def read(self, size: int = -1, /) -> bytes: ...

Shouldn't these return int | None and bytes | None? A FileIO is non-blocking mode can return None from these methods, yes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: ioI/O related issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions