4 ms·
The pros and cons of this was extensively discussed: https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046 https://discuss.python.org/
by notatallshaw 3y ago
The pros and cons of this was extensively discussed: https://discuss.python.org/t/pep-701-syntactic-formalization-of-f-strings/22046 https://discuss.python.org/t/pep-701-syntactic-formalization...
In summary the winning argument was it's always possible to for users to write unreadable code if they want and generally Python does not implement language level arbitrary restrictions to stop this. So, the benefits of a well-defined f-string syntax that is logically consistent outweigh the possibility some users will choose not to follow best practise.
- eddd-ddde 3y agoSo in short they are doing this just for it to end up in every coding style ban list?
- notatallshaw 3y agoBy having a well-defined syntax, it allows: * Other Python implementations to correctly and confidently implement f-strings * CPython to use its regular parser to parse f-strings rather than have a special sub-parser * Lots of edge-cases with f-string syntax to work consistently As you could have read in the discussion rather than a bad-faith comment of "they are doing this just for <bad thing>", obviously no one wants to put a lot of effort into something for it to not have any benefit at all.