I\'d like to be able to do this:
class A(object):
@staticandinstancemethod
def B(self=None, x, y):
print self is None and \"static\" or \"ins
From what you're saying, is this along the line of what you're looking for? I'm not sure there is a way to do exactly what you're saying that is "built in"
class Foo(object):
def __init__(self, a=None, b=None):
self.a
self.b
def Foo(self):
if self.a is None and self.b is None:
form = CreationForm()
else:
form = EditingForm()
return form