On 4/19/2023 7:48 PM, dn via Python-list wrote:
On 20/04/2023 08.59, Thomas Passin wrote:
On 4/19/2023 4:06 PM, Mark Bourne wrote:

print(f'{LIMIT})

^ I think this one should be:

print(f'{LIMIT}')

with the closing quote ;o)

Yup a typo!  Where's pylint when I need it?

but (and you designed it this way - right?) an excellent object-lesson for the OP

AND

great rationale for why linters are so handy!

The Leo editor, which I use, checks the file you are working on for syntax errors and also for undefined variables, missing imports, and the like, when you save it. It gives you a clickable link to the line in question. This is a good compromise because it stays out of your way until you take a break by saving.

I am bullish on F-strings, but they can stretch the typing fingers and strain the eyes. Remember the days when pythonista used to make deprecating remarks about the superiority of Python's syntax because we didn't have 'all those braces' (and other punctuation-characters) cluttering-up the code???

When you get right down for it, there isn't much difference between

'Here is the result: %s, %s' %(a.b, c)

and

'Here is the result: {}, {}'.format(a.b, c)

Readability and typeability aren't much different. It's only when we get to f-strings that there's a real change, and the second form started to prepare us for it (yes, I know that the .format() form lets you use your own formatter - probably a real advantage though I never had occasion to use it)

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

Reply via email to