The following code works for providing a meaningful default value for conns
but it is quite ugly:
def query(s,sql,conns=None):
conns = s.conns() if not conns else conns
A preferred construct would be:
def query(s,sql,conns=s.conns()):
But that is apparently disallowed: I am inferring that instance method invocations are not supported within invocations of other methods on the same instance.
Is there a cleaner pattern for supplying the default/missing parameter?