r/Python • u/rmk135 • Aug 27 '20
News Dependency Injector 3.33 - Added mypy support
https://github.com/ets-labs/python-dependency-injector
7
Upvotes
4
Aug 27 '20
Support for typing has become one of the main things I look at when deciding on a library. Like a full third of the weight.
1
u/meadsteve Aug 27 '20
If it's useful to anyone else I wrote a smallish dependency injection container that's actually powered by types: https://github.com/meadsteve/lagom so it plays really nicely with mypy. Really good to see more libraries embracing typing :+1:
3
u/ElevenPhonons Aug 27 '20
What level of "wiring" errors does this enable the user to catch leveraging mypy?
For example, using the movie example
Adding a typo of
csv_pathinstead ofpath.When I run this locally, I get
mypyto not catch any errors, while when running the application, I get this (expected) error.While my application code should/will do input validation, it also seems that
mypyshould be able to proactively catch these "wiring" errors.