[Python-ideas] function defaults and an empty() builtin

Daniel Stutzbach stutzbach at google.com
Fri May 20 22:21:02 CEST 2011


On Thu, May 19, 2011 at 9:46 PM, Jack Diederich <jackdied at gmail.com> wrote:

> return nothing when asked for something and raise a ValueError when
> any attempt is made to add/remove items.
>

Couldn't you just use the empty immutable version for whatever type the
optional might be?  For sequences, use ().  For sets, use frozenset().  For
dicts, use ... oh.  Crap.

-- 
Daniel Stutzbach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110520/75fc7dbe/attachment.html>


More information about the Python-ideas mailing list