Steven Bethard <steven.bethard <at> gmail.com> writes: > I'm still not a big fan of mixing together getitem-style access and > getattribute-style access. That makes classes that support both > ambiguous in this context. You either need to specify the order in > which these are checked (e.g. attribute then item or item then > attribute), or, preferably, you need to extend the syntax to allow > getitem-style access too. > > Just to be clear, I'm not suggesting that you support anything more > then items and attributes. So this is *not* a request to allow > arbitrary expressions. In fact, the only use-case I see in the PEP > needs only item access, not attribute access, so maybe you could drop > attribute access? > > Can't you just extend the syntax for *only* item access? E.g. something like: > > "My name is {0[name]} :-\{\}".format(dict(name='Fred')) I'm not opposed to the idea of adding item access, although I believe that attribute access is also useful. In either case, its not terribly hard to implement. I'd like to hear what other people have to say on this issue. -- Talin
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