function with list argument defaulting to [] - what's going on here???

Alex Martelli aleax at mac.com
Sun Apr 15 07:03:53 CEST 2007


Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> wrote:

> On Sun, 15 Apr 2007 05:29:01 +0200, BJörn Lindqvist wrote:
> 
> >> This comes up so often that I wonder whether Python should issue a warning
> >> when it sees [] or {} as a default argument.
> >>
> >>
> >> What do people think? A misuse or good use of warnings?
> > 
> > I think Python should reevaluate the default values.
> 
> That would break code that relies on the current behaviour. That makes it
> a "maybe" for Python 3.0, and an absolute "NO!!!" for Python 2.x.

If you hope to get any change in Python 3.0, your PEP had better be in
before the end of April -- that's the 3.0 deadline for PEPs.


Alex



More information about the Python-list mailing list