4 ms·
> If you've ever worked on a Python code base that you didn't design and write from the ground up, you would know that these are inevitable, and in many cases
by guitarbill 8y ago
> If you've ever worked on a Python code base that you didn't design and write from the ground up, you would know that these are inevitable, and in many cases encouraged by the language.
I have. Maybe it is "inevitable", but saying Python encourages this is a stretch. Those things happen in other languages, it's just called `null` abuse instead.
> Not to mention, I can actually run the Mypy static checker on this and verify that my code does what I think it does.
Until it doesn't, e.g. at runtime. Type hints are a nice tool, but are not a panacea. They are not the same as variable types. This is probably the most dangerous thing about them. If you want that, Python is not the best choice, type hints don't change that.