May-28-2017, 01:41 AM
If you really want this for some reason, you could do something like this
class Foo(): def __init__(self): self.method = self.__instance_method @classmethod def method(cls): print("method class =", cls) def __instance_method(self): print("method object =", self) Foo.method() foo = Foo() foo.method()
Output:method class = <class '__main__.Foo'>
method object = <__main__.Foo object at 0x7f76cb5409e8>
But again, making their behavior identical doesn't really make sense.