Re: None

Guido.van.Rossum@cwi.nl
Mon, 25 Apr 1994 17:31:59 +0200

> More specifically, I think that it would be nice if None was also a
> sequence of length zero. I have written code that usually returns a
> list but often the list is empty. In this case, I would rather just
> return None, but doing so requires that the caller check for this
> special case before iterating over the result. If None was a sequence
> of length zero, this would not be a problem. Following this
> reasoning, it would also make sense if None was a mapping of length
> zero.

In the tradition of the Python mailing list, if your name is not
Guido, proposals to change the language have to be accompanied by
examples of code that would benefit from the proposed feature.
Furthermore, if you are proposing an efficiency hack, you will have to
show profiling information that proves the need for the hack.

In other words, what's wrong with returning [] or {}?

:-)

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>