"Compile time" checking?
Steve Jorgensen
nospam at nospam.nospam
Sat Aug 13 01:25:07 EDT 2005
Since Python does not use manifest typing, there's not much you can do about
this, but typeless languages like this are great if you're using a process
that finds the errors the compiler would otherwise find. I'm referring, of
course, to Test Driven Development (TDD).
If you do TDD, you won't miss compile-time checking much. In fact, the extra
kruft that manifest typing requires is an annoying burden when doing TDD, so
Python is a breath of fresh air in this regard.
On 10 Aug 2005 08:53:15 -0700, "Qopit" <russandheather at gmail.com> wrote:
>Hi there,
>
>I'm pretty new to Python and am trying to figure out how to get "will
>this code compile?"-like code checking. To me this is a pretty basic
>language/environment requirement, especially when working with large
>projects. It is *much* better to catch errors at "compile-time" rather
>than at run-time.
>
>One thing I've "found" is the PyChecker module (conveniently embedded
>in SPE), but it doesn't seem to do that great of a job. For example,
>the following simple program checks out perfectly as far as PyChecker
>is concerned:
>
>#----
>def tester(a,b,c):
> print "bogus test function",a,b,c
>tester(1,2,3) #this runs fine
>tester(1,2) #this obviously causes a run-time TypeError exception
>#----
>
>It seems to me that this should be an obvious catch for PyChecker. I
>suppose you could argue that you don't want PyChecker to bark at you
>any time an exception would be raised since you may intentionally be
>causing exceptions, but this one seems a pretty simple and obvious one
>to catch.
>
>My questions are:
>- Am I missing something with my tester example?
>- Are there other code-checking options other than PyChecker?
>
>Any other comments appreciated (aside from things like "just right good
>code that doesn't have bugs like that" :) ).
>
>Thanks!
More information about the Python-list
mailing list