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

Cameron Simpson cs at zip.com.au
Sat May 21 07:25:04 CEST 2011


On 20May2011 15:11, Terry Reedy <tjreedy at udel.edu> wrote:
| 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.

You're missing the point.

This thread is about providing a complex solution to a common problem.

Your technique of providing a simple solution to the problem doesn't
help the thread persist.

[ Hmm, I see my random sig quoter has hit the money again:-)
  Truly, the quote below was pot luck!
]

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

If you can keep your head while all those about you are losing theirs,
perhaps you don't understand the situation.
        - Paul Wilson <Paul_Wilson.DBS at dbsnotes.dbsoftware.com>



More information about the Python-ideas mailing list