Can I define a Python method to be both static and instance at the same time? Something like:
class C(object):
@staticmethod
def a(self, arg1):
if self:
blah
blah
So that I can call it with both:
C.a(arg1)
C().a(arg1)
The intent is to be able to run two sets of logics. If accessed as an instance method, it would make use of instance variables and do stuff. If access as a static method, it will do without.
1 Answer