28 May
2020
28 May
'20
10:37 a.m.
On 28/05/20 8:57 pm, Steven D'Aprano wrote:
The default value used by a parameter is certainly important, and one of the most common reasons I call `help(func)` is to see what the default values are. They should be in the signature, and it is an annoyance when all the signature shows is that it is None, and then I have to trawl through screenfuls of docs, or search the web, to find out what the actual default is.
I think we need a real example to be able to talk about this meaningfully. But I'm having trouble thinking of one. I can't remember ever writing a function with a default argument value that *has* to be mutable and *has* to have a new one created on each call *unless* the caller provided one. Anyone else have one? -- Greg