
Jan. 18, 2007
4:42 p.m.
Joel Bender <jjb5@cornell.edu> wrote:
Calvin Spealman wrote:
I dont understand how that would be different than doing
c = c if c is not None else Bar([2,3,4])
Because that would be calling Bar(), perhaps creating a new Bar object, every time foo() is called with None for c, which is not what a default argument values are about. I'm proposing a way to create function local singleton objects, removing them from the parameter list.
[snip]
and then hoping that nobody calls foo() with a history parameter.
With your proposal, you are seeking to attempt to fix a "problem" that no one has complained about. -1 . - Josiah