Let's suppose we have this class:
class Demo:
def __init__(self, str):
self.str = str
def fromBytes1(bytes):
return Demo(bytes2str(bytes))
@classmethod
def fromBytes2(cls, bytes):
return cls(bytes2str(bytes))
What is the difference between fromBytes1 and fromBytes2, except for the fact that you can't call the 1st method in the following way?
Demo().fromBytes1(bytes)
Is there something more subtle that I cannot see here?