Skip to content

pyserial: read_all cannot return None? #15619

@rtandy

Description

@rtandy

The pyserial documentation says that read returns bytes. The comment in serialutil.pyi discusses this and has read and read_until returning bytes, not bytes | None.

For some reason read_all is typed as returning bytes | None? The implementation simply calls read, so I don't see why it's different from read.

Have I missed something?

Thanks for maintaining typeshed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAn actionable problem of low to medium complexity where a PR would be very welcomestubs: false positiveType checkers report false errors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions