Yes fair point.
That seems more correct
On Thu, Aug 6, 2020 at 2:49 PM MRAB firstname.lastname@example.org wrote:
On 2020-08-06 14:16, Stestagg wrote:
I was following you right up till this bit:
By the way, as previously noted d[1, 2] d[(1, 2)] are at present equivalent. However, in the new syntax d[1, 2, a=3] d[(1, 2), a=3] are not equivalent. (The first has three arguments, the second two, the first of which is a tuple.)
In the "New syntax", wouldn't these examples map to:
d[1, 2, a=3] => d.__getitem__((1, 2), a=3) and d[(1, 2), a=3] => d.__getitem__((1, 2), a=3)
Not quite. The second should be:
d[(1, 2), a=3] => d.__getitem__(((1, 2),), a=3)
I.e. My understanding was that the existing conversion of all positional parameters in a subscript would be packed into a tuple (strictly for consistency with legacy behaviour) while any keywords would be passed as kwargs?
Python-ideas mailing list -- email@example.com To unsubscribe send an email to firstname.lastname@example.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://email@example.com/message/75SBJA... Code of Conduct: http://python.org/psf/codeofconduct/