Re: [Python-ideas] parameter omit

Aaron Brady wrote:
Non-sequitur? How does that relate to what I said? Let me state in different words what others have already stated: There are already ways to accomplish most what you are trying to do. In Python, any argument will have its default value if you omit it from the argument list when calling the function. There's no need to explicitly tell it to use the default value, it just does this naturally. Now, the only case where this might be a problem is a fairly rare and odd case where you are specifying arguments positionally and not by keyword, where you want to specify the value of argument N+1 but want argument N to be its default. But the language should not make a special cases to support this particular case, for 3 reasons: 1) The case is rare. 2) There are easy ways around it: Simply supply the value of argument N+1 by keyword instead of by position. 3) If your function has lots of positional arguments, each of which has a different meaning, then your function probably needs to be refactored anyway. Using keywords is much safer in such cases, and if you use keywords, then the whole problem you raise goes away. -- Talin
participants (2)
-
Aaron Brady
-
Talin