"no variable or argument declarations are necessary."

Magnus Lycka lycka at carmen.se
Wed Oct 5 03:34:55 EDT 2005


en.karpachov at ospaz.ru wrote:
> Some people just don't get the simple fact that declarations are
> essentially kind of unit test you get for free (almost), and the compiler
> is a testing framework for them.

It seems you've missed the entire point of using a dynamically
typed language. It's not just about saving typing time and making
your methods take up fewer lines of code. It's about writing generic
code. Just look at C++ with all that mess with complex templates,
silly casting and dangerous void pointers etc that are needed to
achieve a fraction of the genericity that Python provides with no
effort from the programmer.

With properly written tests, you can be reasonably that the program
does what you want. Type declarations are extremely limited in this
aspect, and they often give programmers a false sense of security.



More information about the Python-list mailing list