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

Thomas Passin list1 at tompassin.net
Mon Oct 10 18:25:42 EDT 2022


On 10/10/2022 9:21 AM, Michael F. Stemper wrote:
> 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.

The Leo editor (https://github.com/leo-editor/leo-editor) will notify 
you of undeclared variables (and some syntax errors) each time you save 
your (Python) file.



More information about the Python-list mailing list