What to use for finding as many syntax errors as possible.

Michael F. Stemper michael.stemper at gmail.com
Mon Oct 10 09:21:41 EDT 2022


On 09/10/2022 10.49, Avi Gross wrote:
> Anton
> 
> There likely are such programs out there but are there universal agreements
> on how to figure out when a new safe zone of code starts where error
> testing can begin?
> 
> For example a file full of function definitions might find an error in
> function 1 and try to find the end of that function and resume checking the
> next function.  But what if a function defines local functions within it?
> What if the mistake in one line of code could still allow checking the next
> line rather than skipping it all?
> 
> My guess is that finding 100 errors might turn out to be misleading. If you
> fix just the first, many others would go away. If you spell a variable name
> wrong when declaring it, a dozen uses of the right name may cause errors.
> Should you fix the first or change all later ones?

How does one declare a variable in python? Sometimes it'd be nice to
be able to have declarations and any undeclared variable be flagged.

When I was writing F77 for a living, I'd (temporarily) put:
       IMPLICIT CHARACTER*3
at the beginning of a program or subroutine that I was modifying,
in order to have any typos flagged.

I'd love it if there was something similar that I could do in python.

-- 
Michael F. Stemper
87.3% of all statistics are made up by the person giving them.


More information about the Python-list mailing list