PEP218: Representing the empty set

John Roth newsgroups at
Tue Feb 17 22:56:18 CET 2004

"Andrew McLean" <spam-trap-095 at> wrote in message
news:Eakvp5MXQnMAFwqT at
> Looking at PEP218 there is a discussion about the most appropriate way
> of representing the empty set. The two alternatives proposed are {} and
> {-}. I was wondering why either of these is needed. Why not just use
> set()?. It is only two more characters than {-} and a bit more explicit.
> Similarly, I find myself initialising dictionaries with dict() rather
> than {}.
> Am I missing something?

A very minor oversight. This discussion only makes sense in
the context of having a set literal. The 2.3 set implementation
certainly didn't, and the latest 2.4 development documentation
(Feb 12) also doesn't, so the discussion is moot.

John Roth
> -- 
> Andrew McLean

More information about the Python-list mailing list