On Sat, Apr 10, 2021 at 2:44 AM Ricky Teachey <ri...@teachey.org> wrote:
>
> On Fri, Apr 9, 2021 at 3:20 AM Serhiy Storchaka <storch...@gmail.com> wrote:
>>
>> 08.04.21 19:58, ucod...@gmail.com пише:
>> > I would like to propose adding literal syntax to allow creation of an 
>> > empty set without the need to call the type constructor. I believe the 
>> > best choice for such a literal, and one that has been proposed before, is 
>> > `{,}`.
>>
>> You can now use `{*()}` as a syntax for empty set.
>
>
> Interestingly, Raymond Hettinger recently had a post on twitter specifically 
> deriding this usage as obfuscatory, and expressing his preference that people 
> not do it (and use set() instead).
>
> https://twitter.com/raymondh/status/1372376414184296448
>
> I tend to agree with him on that... I have no opinion on whether set should 
> be given its own "empty repr literal", but I don't think {*()} is a useful 
> suggestion to give people who want one.
>

Like "1e1000" as a representation of float("inf"), it's a good trick
for contexts where you absolutely have to use syntax with no names.

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

Reply via email to