On 2021-09-01 17:41, Kevin Mills wrote:
Given code like this:

```
d = {1: {2: {3: 4}}}
print(d[1][2][3])
d[1][2][3] = None
print(d)
```

It should be possible to rewrite it using a starred expression, like this:

```
d = {1: {2: {3: 4}}}
keys= 1,2,3
print(d[*keys])
d[*keys] = None
print(d)
```

Hopefully it's clear from that example what I'm suggesting.

Would that be equivalent to d[keys[0], keys[1], keys[2]]?

If so, it would be equivalent to something that's already legal, namely, a subscript that's a tuple.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/RCFRVS6L3HZ2HKUYKNVMTRFXQDL22YZR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to