Non-Reflexive Class Method
We'll cover the following...
Class methods can be puzzling at times.
Press + to interact
class SomeClass:def instance_method(self):pass@classmethoddef class_method(cls):passprint(SomeClass.instance_method is SomeClass.instance_method)print(SomeClass.class_method is SomeClass.class_method)print(id(SomeClass.class_method) == id(SomeClass.class_method))
Explanation
- The reason
SomeClass.class_method is SomeClass.class_method
isFalse
is