On 2015-08-10 2:37 PM, Eric V. Smith wrote: >> Besides, any expression you have to calculate can go in a local that will get >> >interpolated. The same goes for any !r or other formatting modifiers. In an >> >i18n context, you want to stick to the simplest possible substitution >> >placeholders. > This is why I think PEP-498 isn't the solution for i18n. I'd really like > to be able to say, in a debugging context: > > print('a:{self.a} b:{self.b} c:{self.c} d:{self.d}') > > without having to create locals to hold these 4 values. Why can't we restrict expressions in f-strings to attribute/item getters? I.e. allow f'{foo.bar.baz}' and f'{self.foo["bar"]}' but disallow f'{foo.bar(baz=something)}' Yury
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4