brainlit
brainlit copied to clipboard
Improve type checking via typeguard
As the repo is refactored (see the Reformatting project), pep484 type hints are being added (example here).
Typeguard allows for type checking via pep484 type hints, and using them would streamline the codebase and reduce some clutter.
Doing this instead of multiple lines of check_type(<input>, <type>)
is far cleaner.
Lines to be changed include every type-checking line after a method (for example, upload.py
lines 48-51). You can identify the line if it begins with check_
.
Scripts with type hints and checking so far include:
- methods in upload.py
- methods in session.py
link to specific lines that you want changed.
lines to be changed are every single type-checking line after a method (for example, upload.py
lines 48-51).
Scripts with type hints and checking so far include:
- methods in upload.py
- methods in session.py