[Bootcamp Task] Implement static typing for thumbor/app.py #5
Labels
L1
Level 1 Bootcamp Task
mypy
Tasks related to static typing using MyPy.
task
Bootcamp task. Feel free to grab it and work on it. For more information ping a bootcamp mentor.
thumbor/app.py
label for fixing issues with the specified file
Areas of Expertise
MyPy, static typing
You will learn more about how to use statically typed python code. mypy is an optional static type checker for python. It provides compile-time type checking.
Summary
In this task you'll fix
thumbor/app.py
to be typed.Involved Modules
Task Relevance
Providing type safety is important both for thumbor and the projects that depend on it. This way we can eliminate type errors, like
None
where you don't expectNone
or an integer where you expect a string.How to complete this task?
To complete this task, read mypy docs on how to get started and run
mypy thumbor/app.py
from thumbor's virtualenv.When creating this task, this was the output of running
mypy thumbor/app.py
:This gives you all errors in the file you will fix. Don't worry if there are types of other packages (other thumbor files or thumbor dependencies) failing. If that's the case we can ignore these for now using this kind of annotation:
For more details check this page.
Once you get to a point where running
mypy thumbor/app.py
returns no errors, go ahead and submit a PR. The output should look like this:Task Workflow
The workflow for completing tasks in thumbor goes like this:
The text was updated successfully, but these errors were encountered: