type checking

Terry Reedy tjreedy at udel.edu
Sun Oct 12 02:15:35 EDT 2003


"sashan" <mabus at operamail.com> wrote in message
news:bmafsm$3i9$1 at lust.ihug.co.nz...
> I'm a Python newbie. I have been using c++ for 5 years and before
that I
>   was programming in Pascal. The one thing that annoys me about
python
> is dynamic typing because I find myself making typographical errors
of
> the sort that would under C++ be picked up by the compiler at
compiler
> time.

I am beginning to realize that different people probably have
different typo 'profiles', so that I missed typing checks less than I
'missed' writing type declarations (which are another opportunity for
error ;-).

>  With Python I have to wait for the error to appear at runtime in
> order for me to correct it.

In my experience with small functions and programs, Python error
reports come about as fast or faster as C error reports did a decade
ago.  Syntax
errors get reported at compile time for Python also.

> I find this inefficient. Any advice about
> how to get around this would be appreciated.

I suspect that people sometimes became dependent on the system they
use finding the errors it is good at finding, and become a bit
careless with respect to that type of error and focus proofreading on
others that that system is less good at finding.  I probably worry
less about syntax errors with Python than I did with Fortran on
punched cards (and an hour or more of turnaround time).

Terry J. Reedy







More information about the Python-list mailing list