3 ms·
Security was not my primary concern, but even if the design can be made secure, it is still a concern (because bugs happen). In any case, you just stated anothe
by asgard1024 11y ago
Security was not my primary concern, but even if the design can be made secure, it is still a concern (because bugs happen). In any case, you just stated another counter argument - it breaks orthogonality of the language (string being interpolated must be a literal), just to make one assignment not explicit.
Maybe it is popular in other languages - their call, but the fact is, it goes quite wildly against Python design philosophy.
I would also like to note that the are templating systems that let you evaluate arbitrary Python expressions. Perhaps these would be a better choice for users who feel need for this proposal.
- baq 11y agoi agree that there are multiple templating solutions, but i disagree that they fill the same niche. this is a language usability (UX even) thing, not a purity thing. the fact is people do '...'.format(locals()) for the same purpose (or '...' % locals()), which is strictly worse and may not even work on some python implementations. i also disagree that this feature goes against the zen of python: practicality beats purity, after all.