parameter name conflict. How to solve?
Delaney, Timothy C (Timothy)
tdelaney at avaya.com
Tue Mar 8 18:08:21 EST 2005
Bo Peng wrote:
>> Is this a style guide thing?
>>
>> Why not just:
>>
>> def func(output_param=''):
>> output(output=output_param)
>>
>
> This is exactly the problem. There are a bunch of other functions that
> use output='' parameter. Changing parameter name for this single
> function may cause confusion.
So why not rename the `output` function? Or alternatively, you could
change the parameter name for everything (not recommended).
I can assure you that when someone goes to maintain this code, having a
function go through all kinds of schenanigans to support what you want
to do will be much more confusing than a different parameter name.
Tim Delaney
More information about the Python-list
mailing list