While I don't like that syntax, we do know that sets are unhashable, so we
can be certain that that would be a TypeError if it was meant to construct
a set containing a set. (ie. {{foo}} will always result in a TypeError in
python).

On Thu, Jun 8, 2017 at 1:40 PM Chris Angelico <ros...@gmail.com> wrote:

> On Fri, Jun 9, 2017 at 6:02 AM, MRAB <pyt...@mrabarnett.plus.com> wrote:
> > It could also be used on the RHS to pack:
> >
> >>>> a = 1
> >>>> b = 2
> >>>> c = 3
> >>>> d = 4
> >>>> foo = {{a, b, c, d}}
>
> The trouble with that is that it's syntactically identical to creating
> a set containing a set containing four values. That may cause
> problems.
>
> ChrisA
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to