[Python-ideas] function defaults and an empty() builtin
Terry Reedy
tjreedy at udel.edu
Fri May 20 21:11:12 CEST 2011
On 5/20/2011 1:51 PM, Masklinn wrote:
I am as puzzled as other people.
> empty() is both an empty list (because the code iterates over a list
> for instance, or maps it, or what have you) and an assertion that
> this list is *not* to be modified.
So use () as the default. It has all the methods of [] except for the
mutation methods.
--
Terry Jan Reedy
More information about the Python-ideas
mailing list