[Python-ideas] Accepting keyword arguments for __getitem__

Chris Angelico rosuav at gmail.com
Mon Jun 23 18:18:24 CEST 2014


On Tue, Jun 24, 2014 at 1:59 AM, Stefano Borini
<stefano.borini at ferrara.linux.it> wrote:
> I am not a big fan either of my own idea. I just threw a bone to see if it
> has
> already been discussed or if anyone would envision other possible use cases
> for
> this notation.

Best place to go from here would be a preparser, which you can then
publish. If, at some later date, someone else has a similar need, s/he
can see what you did and either (1) use it as-is and utter a prayer of
thanks that someone's done the work already; (2) tweak it to fit the
exact situation required; or (3) grumble at your code, and come back
to python-ideas with a proposal.

The proposal from #3 would sound something like this: "Here's my
use-case. There's this recipe on the internet <link> but it's awkward
because X and Y, and it'd be so much better if this could be supported
by the core language." And then we'd have this long and fruitful
discussion (Sir Humphrey Appleby would approve!), figuring out whether
it's of value or not, all with the solid basis of two separate
use-cases for the same new syntax.

ChrisA


More information about the Python-ideas mailing list