#decorators in python
def star(func):
    def inner(*args, **kwargs):
        print("*" * 30)
        func(*args, **kwargs)
        print("*" * 30)
    return inner


def percent(func):
    def inner(*args, **kwargs):
        print("%" * 30)
        func(*args, **kwargs)
        print("%" * 30)
    return inner


@star
@percent
def printer(msg):
    print(msg)


printer("Hello")

#python property decorators
# Basic method of setting and getting attributes in Python
class Celsius:
    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return (self.temperature * 1.8) + 32


# Create a new object
human = Celsius()

# Set the temperature
human.temperature = 37

# Get the temperature attribute
print(human.temperature)

# Get the to_fahrenheit method
print(human.to_fahrenheit())

# using property class
class Celsius:
    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return (self.temperature * 1.8) + 32

    # getter
    def get_temperature(self):
        print("Getting value...")
        return self._temperature

    # setter
    def set_temperature(self, value):
        print("Setting value...")
        if value < -273.15:
            raise ValueError("Temperature below -273.15 is not possible")
        self._temperature = value

    # creating a property object
    temperature = property(get_temperature, set_temperature)


human = Celsius(37)

print(human.temperature)
print(human.temperature)

print(human.to_fahrenheit())
22c26f027fde3c8d05fe2bdb4b4907c9db30e9bf
<mask token>


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature
    <mask token>


<mask token>


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return self.temperature * 1.8 + 32

    def get_temperature(self):
        print('Getting value...')
        return self._temperature

    def set_temperature(self, value):
        print('Setting value...')
        if value < -273.15:
            raise ValueError('Temperature below -273.15 is not possible')
        self._temperature = value
    temperature = property(get_temperature, set_temperature)


<mask token>

<mask token>


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return self.temperature * 1.8 + 32


<mask token>


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return self.temperature * 1.8 + 32

    def get_temperature(self):
        print('Getting value...')
        return self._temperature

    def set_temperature(self, value):
        print('Setting value...')
        if value < -273.15:
            raise ValueError('Temperature below -273.15 is not possible')
        self._temperature = value
    temperature = property(get_temperature, set_temperature)


<mask token>

def star(func):

    def inner(*args, **kwargs):
        print('*' * 30)
        func(*args, **kwargs)
        print('*' * 30)
    return inner


def percent(func):

    def inner(*args, **kwargs):
        print('%' * 30)
        func(*args, **kwargs)
        print('%' * 30)
    return inner


<mask token>


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return self.temperature * 1.8 + 32


<mask token>


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return self.temperature * 1.8 + 32

    def get_temperature(self):
        print('Getting value...')
        return self._temperature

    def set_temperature(self, value):
        print('Setting value...')
        if value < -273.15:
            raise ValueError('Temperature below -273.15 is not possible')
        self._temperature = value
    temperature = property(get_temperature, set_temperature)


<mask token>

def star(func):

    def inner(*args, **kwargs):
        print('*' * 30)
        func(*args, **kwargs)
        print('*' * 30)
    return inner


def percent(func):

    def inner(*args, **kwargs):
        print('%' * 30)
        func(*args, **kwargs)
        print('%' * 30)
    return inner


@star
@percent
def printer(msg):
    print(msg)


printer('Hello')


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return self.temperature * 1.8 + 32


<mask token>
print(human.temperature)
print(human.to_fahrenheit())


class Celsius:

    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return self.temperature * 1.8 + 32

    def get_temperature(self):
        print('Getting value...')
        return self._temperature

    def set_temperature(self, value):
        print('Setting value...')
        if value < -273.15:
            raise ValueError('Temperature below -273.15 is not possible')
        self._temperature = value
    temperature = property(get_temperature, set_temperature)


<mask token>
print(human.temperature)
print(human.temperature)
print(human.to_fahrenheit())

#decorators in python
def star(func):
    def inner(*args, **kwargs):
        print("*" * 30)
        func(*args, **kwargs)
        print("*" * 30)
    return inner


def percent(func):
    def inner(*args, **kwargs):
        print("%" * 30)
        func(*args, **kwargs)
        print("%" * 30)
    return inner


@star
@percent
def printer(msg):
    print(msg)


printer("Hello")

#python property decorators
# Basic method of setting and getting attributes in Python
class Celsius:
    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return (self.temperature * 1.8) + 32


# Create a new object
human = Celsius()

# Set the temperature
human.temperature = 37

# Get the temperature attribute
print(human.temperature)

# Get the to_fahrenheit method
print(human.to_fahrenheit())

# using property class
class Celsius:
    def __init__(self, temperature=0):
        self.temperature = temperature

    def to_fahrenheit(self):
        return (self.temperature * 1.8) + 32

    # getter
    def get_temperature(self):
        print("Getting value...")
        return self._temperature

    # setter
    def set_temperature(self, value):
        print("Setting value...")
        if value < -273.15:
            raise ValueError("Temperature below -273.15 is not possible")
        self._temperature = value

    # creating a property object
    temperature = property(get_temperature, set_temperature)


human = Celsius(37)

print(human.temperature)
print(human.temperature)

print(human.to_fahrenheit())