parameter name conflict. How to solve?

Greg Ewing greg at
Tue Mar 8 23:53:26 CET 2005

Bo Peng wrote:

> def func(output=''):
>   output(output=output)

Another solution that hasn't been mentioned yet:

   def func(**kwds):
     output(output = kwds['output'])

You might want to do some more checking on the
contents of kwds to make sure it doesn't
contain any other nonsense parameters.

Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand

More information about the Python-list mailing list