Skip to content

Add explicit return None to fg_color and bg_color in screen.py#601

Merged
gnachman merged 1 commit intognachman:masterfrom
mkusaka:fix/screen-missing-return-none
Mar 2, 2026
Merged

Add explicit return None to fg_color and bg_color in screen.py#601
gnachman merged 1 commit intognachman:masterfrom
mkusaka:fix/screen-missing-return-none

Conversation

@mkusaka
Copy link
Contributor

@mkusaka mkusaka commented Mar 2, 2026

Summary

CellStyle.fg_color and bg_color properties dispatch on protobuf oneof fields via if/elif chains but lack an explicit return None when no branch matches. mypy requires an explicit return statement even when the return type is Optional:

screen.py:175: error: Missing return statement  [return]
screen.py:191: error: Missing return statement  [return]

Added return None after each if/elif chain.

The fg_color and bg_color properties dispatch on protobuf oneof fields
via if/elif chains but lack an explicit return None when no branch
matches. mypy requires an explicit return statement even when the
return type is Optional.
@gnachman gnachman merged commit 52c18d7 into gnachman:master Mar 2, 2026
2 checks passed
@mkusaka mkusaka deleted the fix/screen-missing-return-none branch March 3, 2026 04:39
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.

2 participants