Simple pychecker question
Peter Hansen
peter at engcorp.com
Sun Jun 9 03:04:09 EDT 2002
Neal Norwitz wrote:
>
> I personally think that superfluous use of named args are bad,
> but that the feature is good when used properly. For example,
> with your code above, calling f(f=2) would be better written
> f(2). However for Tkinter, named args can be useful when there
> are a bunch of parameters and you only want to use the last.
For a routine named and structured like this:
def transmit(data, timeout=1.0):
which of the following would you say was the better call
in some code that might be remote from that definition
above?
1. transmit('this is a string', 5)
2. transmit('this is a string', timeout=5)
My point: named arguments can increase readability and
maintainability. That's not superfluous, to me.
-Peter
More information about the Python-list
mailing list