Is this a breaking change? It feels borderline.
Keyword-only subscripts are permitted. The positional index will be the
> empty tuple:
> obj[spam=1, eggs=2]
> # calls type(obj).__getitem__(obj, (), spam=1, eggs=2)
I.e. consider:
>>> d = dict()
>>> d[()] = "foo"
>>> d
{(): 'foo'}
I don't really object to this fact, and one could argue it's not a breaking
change since a built-in dict will simply raise an exception with keyword
arguments. However, it does make the empty tuple the "default key" for new
objects that will accept keyword indices.
--
The dead increasingly dominate and strangle both the living and the
not-yet born. Vampiric capital and undead corporate persons abuse
the lives and control the thoughts of homo faber. Ideas, once born,
become abortifacients against new conceptions.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/65KCDFYRUWH6K4HHMZT4UJTPDLE7JOPK/
Code of Conduct: http://python.org/psf/codeofconduct/