Hello,
On Thu, 11 Feb 2021 23:57:16 -0500
Random832 <[email protected]> wrote:
[]
> > > I'd like to propose the following:
> > >
> > > w = (): [12]
> >
> > What will be the meaning of {(): [12]} ? Hint: it will be a
> > dictionary of empty tuple mapping to a list, where do you see
> > lambda here?
>
> This could be solved with parentheses,
No, it can't be - parentheses are optional, and without them,
"(): [12]" and "{(): [12]}" would mean wildly different things. And any
programming language should aim to minimize and avoid such cases.
It's a similar concern which was raised for PEP642 (pattern matching
alternatives), where syntax looking related to sets, was suddenly
repurposed to mean dicts instead. Such cases are highly confusing.
[]
--
Best regards,
Paul mailto:[email protected]
_______________________________________________
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/KS5YRMMVKYK5LCUQOS3IXC7DJXGUC7TV/
Code of Conduct: http://python.org/psf/codeofconduct/