
# A static method is tied to the class, not to its instance. 
#
# This may remind you of a class method but the key difference is that 
# a static method doesn’t modify the class at all. 
#
# In other words, a static method doesn’t take self or cls as its arguments.

# We most often use a static method as a utility related to the class.
# 
# Let’s continue with the Weight class. 

class Weight:
    def __init__(self, kilos):		# self is reserved param for object
        self.kilos = kilos
    
    @classmethod
    def from_pounds(cls, pounds):	# cls is a reserved param for className
        # convert pounds to kilos
        kilos = pounds / 2.205

        # cls IS the same as Weight (classname). 
	# So: calling cls(kilos) is the same as Weight(kilos)
        return cls(kilos)

# Start by adding a static method conversion_info() to tell how kilos 
# are converted to pounds:

class Weight:
    def __init__(self, kilos):
        self.kilos = kilos
    
    @classmethod
    def from_pounds(cls, pounds):
        # convert pounds to kilos
        kilos = pounds / 2.205
        # cls is the same as Weight. calling cls(kilos) is the same as Weight(kilos)
        return cls(kilos)
    
    @staticmethod
    def conversion_info():
        print("Kilos are converted to pounds by multiplying by 2.205.")

# Now you can use this utility to print how the conversion happens:

Weight.conversion_info()
