[Python-Dev] repeated keyword arguments

tomer filiba tomerfiliba at gmail.com
Sat Jun 28 10:30:38 CEST 2008


On Jun 28, 12:56 am, "Guido van Rossum" <gu... at python.org> wrote:
> No, it could just be a harmless typo in a long argument list.

to elaborate on this point a little, i came across this error when i
ported my code to 2.4. i used the optparse class which takes 10's of
kwargs, and it turned out i'd given the same parameter twice (the
infamous copy-paste problem).

so on the one hand, it was a harmless typo (because the latest
instance was taken). on the other hand, it's a good thing i tested it
on 2.4, or i'd never notice the repeated argument, which may have led
to weird runtime errors (if the order of the params was changed).

i'd be in favor of fixing this in 2.5, just to eliminate possibly hard-
to-debug runtime errors. since it's a syntax error, it would be early-
noticed when the code is first run/imported, and it wouldn't require
the original author of the code to fix.


-tomer


More information about the Python-Dev mailing list