On Thu, Aug 27, 2020, 1:15 PM Christopher Barker

> I agree -- this is very much a feature for third party packages -- or
> *maybe* some future stdlib class, but the builtins are fine as they are.
>
> In fact, I don't think there's a single use of a tuple of indexes (meaning
> something other than an arbitrary single object) in the stdlib is there? I
> know I've only used that in numpy.
>

I don't know whether it is in the stdlib, but I sometimes use tuples as
dict keys. E.g.

    mydict[('mertz', 'david')] = 3.1415

Even though I could omit them, I'd almost surely use the parens for that.
And more likely it would be:

    name = ('mertz', 'david')
    mydict[name] = 3.1415

Conceptually, an "immutable collection" serves a different purpose than "a
collection of axes", even if they work then same under the hood.

>
_______________________________________________
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/SJROYV73L4SS5Q55YMIZ3DXSUUZWHZ2S/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to