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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com