Mark Roseman added the comment:
I like Terry's idea of providing a better error message than just "invalid
syntax" when we run something that likely isn't a Python file. There doesn't
seem to be any great danger in trying to run any file that would justify a
warning beforehand.
--
Terry J. Reedy added the comment:
I disagree. IDLE already shows a note -- in the editor window -- with the
first noted divergence from python code marked. We are trying to keep IDLE
relatively simple and not clutter it with trivial options.
ispythonsource is just a guess. The decision
E. Paine added the comment:
I think this sounds like a very good idea. I would recommend using the
`ispythonsource` method (in the editor class) as it already has all the logic
you need while also checking for a start line like "#!/usr/bin/env python"
(rather than relying solely on the