What is the benefit to using a dynamically typed language if you have to spend all your time writing tests and verifying the static properties of your code?
And its not like you need static typing everywhere just in some places its better to enforce it for your own sanity. Type hinting looks like a good way to solve this problem in python.
That image isn't really a fair comparison (in that C++ / Java aren't the only statically typed languages.)
I imagine a statically typed Python dialect would only have an extra 15 or so lines, and the benefits would be numerous.
I love python as much as anyone, but having to keep a reference manual handy just to use someone's library because they had the audacity to use a variable is not my idea of a fun time.
EDIT: I'm probably exaggerating too much.
Would I use Python in a large, complicated, multi-developer project? Yes, I would. And my only real complaint would probably be that I like static typing so much that I'd miss it.
All type declarations are optional. It compiles modules to versions completely interoperable with the rest of Python code. They're importable, behave as you'd expect, etc.
I've never had to spend all my time doing that. I am making the case that type errors (passing a hash instead of an int, etc) are NOT one of the major causes of errors in software development.
I'm apt to screw up other things, but that's not one of them.
> I am making the case that type errors are NOT one of the major causes of errors in software development.
That's symptom of a bad typing system. I'm with a moderately sized Haskell codebase right now and type errors represent the biggest share of errors on it by a huge margin - several times bigger than runtime bugs.
NB I'm not being flippant - I've been using Python for a couple of years and appreciate the lack of boilerplate compared to many other languages and if there are "type" problems my unit tests, which I will be writing anyway, find them. Using an IDE like PyCharm does a good job of warning you about type problems at development time so I don't have a lot of run time type problems.
Well, I wouldn't write a unit test for that - I would write a unit test for the high level observable behavior and if I get it wrong that something is a list then it'll break and my unit test will fail.
The idea is that writing code + writing tests in a dynamically typed language is easier and faster just writing code in a statically typed language.
(Of course it depends on the languages in question, the programmers and a number of other factors)