brainlit icon indicating copy to clipboard operation
brainlit copied to clipboard

Improve type checking via typeguard

Open bvarjavand opened this issue 4 years ago • 2 comments

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:

bvarjavand avatar Aug 06 '20 00:08 bvarjavand

link to specific lines that you want changed.

jovo avatar Aug 07 '20 19:08 jovo

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:

bvarjavand avatar Aug 08 '20 05:08 bvarjavand