A literal string type for Python
A literal string type for Python
Posted Apr 26, 2022 15:25 UTC (Tue) by nye (guest, #51576)In reply to: A literal string type for Python by ovitters
Parent article: A literal string type for Python
By restricting the feature to simply "is this a literal string, or derived from literal strings purely by means of concatenation"[0], the meaning is well-defined and easier to understand. In other words, it depends less upon programmer education, which is a strategy that has been repeatedly proven ineffective.
There is some discussion about this in https://wiki.php.net/rfc/is_literal if you're interested - that's the proposal for a very similar feature in PHP, which sadly did not pass for reasons I've not yet investigated.
[0] This PEP is a bit broader than that and does include some operations that create substrings, which makes me uncomfortable.
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
