Why static typed languages are sometimes better.
Wai Yip Tung
tungwaiyip at yahoo.com
Thu Jul 1 17:54:27 EDT 2004
I agree. I appreciate the dynamic and polymorphic power of Python. On the
other hand I hope it does a better job to catch my silly mistakes and
typos. If only there is something like a lint it would save me something
fixing runtime errors.
Wai Yip Tung
On Thu, 01 Jul 2004 17:43:56 -0400, Roy Smith <roy at panix.com> wrote:
> I just had an interesting little surprise. I've got a method that takes
> a string as an argument. I wanted to change it to take either a string
> or a tuple of strings, so I did my usual "test first" thing.
>
> I changed the unit test I already had from calling it with a string to
> calling it with tuple of two strings. I then ran the test, expecting it
> to fail. The next step would be to go write the code to make the test
> pass.
>
> Amazingly, the test passed (that means I'm done, right?). Well, it took
> me a moment to realize that the only thing I ever do with the argument
> in the current version is use it as a dictionary key. Since a tuple of
> two strings is a valid key, so the test passed just fine. Sometimes the
> language is just too forgiving :-)
More information about the Python-list
mailing list