[Python-ideas] Empty set {} and empty dict {:} ?

Guido van Rossum guido at python.org
Thu Jan 17 19:27:47 CET 2008


Right. All possible proposals have already been discussed at length.
Really, writing set() isn't so bad. Get used to it.

On Jan 17, 2008 10:23 AM, George Sakkis <george.sakkis at gmail.com> wrote:
> On Jan 17, 2008 1:10 PM, Steven Bethard <steven.bethard at gmail.com> wrote:
> > On Jan 17, 2008 3:15 AM, Mark Summerfield <mark at qtrac.eu> wrote:
> > > I just wondered if changing the empty set & dict syntax might be
> > > possible.
> > >
> > >     s = {}  # empty set
> > >     d = {:} # empty dict
> > >
> > > I think this would be more understandable to newcomers since to create
> > > single element ones we have:
> > >
> > >     s = {1}
> > >     d = {1:1}
> > >
> > > ?
> >
> > This was discussed when set literals were added.  It was decided that
> > it would be too much of a backwards incompatibility even for Python
> > 3.0.  It may be worth re-considering for Python 4.0.  ;-)
>
> How about {/} for empty sets ? (although chances are that this or
> something similar has been discussed and rejected too :)).
>
> George
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-ideas mailing list