Re: Where is the error?

2023-08-07 Thread Michael Agbenike via Python-list
When i try to open a python script it either says theres no ctk module or
no pip

On Sun, Aug 6, 2023, 3:51 PM Peter J. Holzer via Python-list <
python-list@python.org> wrote:

> Mostly, error messages got a lot better in Python 3.10, but this one had
> me scratching my head for a few minutes.
>
> Consider this useless and faulty script:
>
> 
> r = {
> "x": (1 + 2 + 3)
> "y": (4 + 5 + 6)
> "z": (7 + 8 + 9)
> }
> 
>
> Python 3.9 (and earlier) reports:
>
> 
>   File "/home/hjp/tmp/foo", line 3
> "y": (4 + 5 + 6)
> ^
> SyntaxError: invalid syntax
> 
>
> This isn't great, but experience with lots of programming languages
> tells me that an error is noticed where or after it actually occurs, so
> it's easy to see that there is a comma missing just before the "y".
>
> Python 3.10 and 3.11 report:
>
> 
>   File "/home/hjp/tmp/foo", line 2
> "x": (1 + 2 + 3)
>   ^^
> SyntaxError: invalid syntax. Perhaps you forgot a comma?
> 
>
> The error message is now a lot better, of course, but the fact that it
> points at the expression *before* the error completely threw me. The
> underlined expression is clearly not missing a comma, nor is there an
> error before that. My real program was a bit longer of course, so I
> checked the lines before that to see if I forgot to close any
> parentheses. Took me some time to notice the missing comma *after* the
> underlined expression.
>
> Is this "clairvoyant" behaviour a side-effect of the new parser or was
> that a deliberate decision?
>
> hp
>
> --
>_  | Peter J. Holzer| Story must make more sense than reality.
> |_|_) ||
> | |   | h...@hjp.at |-- Charles Stross, "Creative writing
> __/   | http://www.hjp.at/ |   challenge!"
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the error?

2023-08-07 Thread Cameron Simpson via Python-list

On 07Aug2023 08:02, Barry  wrote:

On 7 Aug 2023, at 05:28, Cameron Simpson via Python-list 
 wrote:
Used to use a Pascal compiler once which was uncannily good at 
suggesting where you'd missing a semicolon.


Was that on DEC VMS? It was a goal at DEC for its compilers to do this well.


No, a PDP-11 using V7 UNIX.


They could output the errors in a machine readable format to allow editors to 
auto fix.
I am learning rust and it is very good at suggesting fixes.
There is a command to apply fixes automatically, cargo fix.


Neat.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Where is the error?

2023-08-07 Thread Barry via Python-list



> On 7 Aug 2023, at 05:28, Cameron Simpson via Python-list 
>  wrote:
> 
> Used to use a Pascal compiler once which was uncannily good at suggesting 
> where you'd missing a semicolon.

Was that on DEC VMS? It was a goal at DEC for its compilers to do this well.
They could output the errors in a machine readable format to allow editors to 
auto fix.

I am learning rust and it is very good at suggesting fixes.
There is a command to apply fixes automatically, cargo fix.

Barry




-- 
https://mail.python.org/mailman/listinfo/python-list