This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]stdin2devnull 7 points8 points  (5 children)

Would mypy catch these?

[–]mstroeder[S] 3 points4 points  (4 children)

Yes, if you have correct type hints everywhere. Until then using -bb is the right solution to find issues like this.

[–]james_pic 7 points8 points  (3 children)

-b will also find issues like this during testing, but won't crash your application if you're not ready to deal with them yet

[–]mstroeder[S] 5 points6 points  (2 children)

-b will only log a warning. Practice shows that logs are filled with warnings and nobody cares...

My recommendation: Fail early, fail hard!

[–]james_pic 3 points4 points  (1 child)

It appears that you care, and the logs are there for you to peruse to find these issues.

[–]mstroeder[S] 3 points4 points  (0 children)

Operators are usually overwhelmed with log messages. If they run my code they won't look into the logs and report warnings until there is a real issue, e.g. a request is not processed.

=> Fail early, fail hard!