Re: f-string syntax deficiency?

2023-06-06 Thread Mark Bourne via Python-list
Roel Schroeven wrote: Op 6/06/2023 om 16:08 schreef Chris Angelico: On Wed, 7 Jun 2023 at 00:06, Neal Becker wrote: > > The following f-string does not parse and gives syntax error on 3.11.3: > > f'thruput/{"user" if opt.return else "cell"} vs. elevation\n' > > However this expression, which

Re: f-string syntax deficiency?

2023-06-06 Thread Roel Schroeven via Python-list
Op 6/06/2023 om 16:48 schreef Chris Angelico via Python-list: On Wed, 7 Jun 2023 at 00:42, Roel Schroeven wrote: > (Recently there has been an effort to provide clearer and more useful > error messages; this seems to be a case where there is still room for > improvement: "SyntaxError: invalid

Re: f-string syntax deficiency?

2023-06-06 Thread Chris Angelico via Python-list
On Wed, 7 Jun 2023 at 00:42, Roel Schroeven wrote: > (Recently there has been an effort to provide clearer and more useful > error messages; this seems to be a case where there is still room for > improvement: "SyntaxError: invalid syntax" doesn't immediately remind me > of that fact that

Re: f-string syntax deficiency?

2023-06-06 Thread Roel Schroeven
Op 6/06/2023 om 16:41 schreef Roel Schroeven: 'return' being a keyowrd is definitely going to be the problem. *keyword -- "Don't Panic." -- Douglas Adams, The Hitchhiker's Guide to the Galaxy -- https://mail.python.org/mailman/listinfo/python-list

Re: f-string syntax deficiency?

2023-06-06 Thread Roel Schroeven
Op 6/06/2023 om 16:08 schreef Chris Angelico: On Wed, 7 Jun 2023 at 00:06, Neal Becker wrote: > > The following f-string does not parse and gives syntax error on 3.11.3: > > f'thruput/{"user" if opt.return else "cell"} vs. elevation\n' > > However this expression, which is similar does parse

Re: f-string syntax deficiency?

2023-06-06 Thread Chris Angelico
On Wed, 7 Jun 2023 at 00:06, Neal Becker wrote: > > The following f-string does not parse and gives syntax error on 3.11.3: > > f'thruput/{"user" if opt.return else "cell"} vs. elevation\n' > > However this expression, which is similar does parse correctly: > > f'thruput/{"user" if True else

f-string syntax deficiency?

2023-06-06 Thread Neal Becker
The following f-string does not parse and gives syntax error on 3.11.3: f'thruput/{"user" if opt.return else "cell"} vs. elevation\n' However this expression, which is similar does parse correctly: f'thruput/{"user" if True else "cell"} vs. elevation\n' I don't see any workaround.