Guys, I just started python recently and get confused with the optional parameters, say I have the program like this:
class B: pass class A: def __in
Yes; default parameters are evaluated only at the time when the function is defined.
One possible solution would be to have the parameter be a class rather than an instance, a la
def foo(blah, klass = B): b = klass() # etc