Skip to content

fix(core): replace incorrect NoReturn with None type hints - #4

Merged
Halvani merged 1 commit into
mainfrom
fix/noreturn-type-annotations
Aug 21, 2026
Merged

Halvani merged 1 commit into
mainfrom
fix/noreturn-type-annotations

Conversation

@Halvani

@Halvani Halvani commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Three methods annotated -> NoReturn actually return normally:

  • __jsonfiles_present — returns None when files present, only raises on missing files
  • __init__ — constructors must return None
  • pretty_print — prints and returns None

NoReturn means "never returns normally", which caused IDEs/type checkers to flag all code after these calls as unreachable.

Also removed the now-unused NoReturn import and updated the docstring.

Fixes #2

Three methods annotated -> NoReturn actually return normally:
__jsonfiles_present (returns None when files present, only raises on
missing files), __init__ (constructors must return None), and
pretty_print (prints and returns None).

NoReturn means "never returns normally", which caused IDEs/type
checkers to flag all code after these calls as unreachable (see issue #2).

Fixes #2
@Halvani
Halvani merged commit ade6622 into main Aug 21, 2026
5 checks passed
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.

Improve type

1 participant