Skip to content

Fix pyserial read_all return type#15785

Closed
MapleQiAN wants to merge 1 commit into
python:mainfrom
MapleQiAN:fix-pyserial-read-all-return
Closed

Fix pyserial read_all return type#15785
MapleQiAN wants to merge 1 commit into
python:mainfrom
MapleQiAN:fix-pyserial-read-all-return

Conversation

@MapleQiAN
Copy link
Copy Markdown

Closes #15619.

serial.serialutil.SerialBase.read_all() returns bytes, not None, so this narrows the stub return type and adds a test case covering the inferred type.

Test: PYTHONPATH=lib python tests/mypy_test.py stubs\pyserial

@github-actions

This comment has been minimized.

@MapleQiAN MapleQiAN force-pushed the fix-pyserial-read-all-return branch from 50e97e5 to eddf7be Compare May 13, 2026 12:16
@MapleQiAN
Copy link
Copy Markdown
Author

Closing this because #15620 is already open for the same pyserial read_all issue. I missed the duplicate PR before opening this one.

@MapleQiAN MapleQiAN closed this May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyserial: read_all cannot return None?

1 participant