Decorators

Decorators — a function that takes another function and extends the behavior of the latter function without explicitly modifying it.

Decorators — a design pattern in Python that allows a user to add new functionality to an existing object without modifying its structure.

def uppercase_decorator(function):
    def wrapper():
        func = function()
        make_uppercase = func.upper()
        return make_uppercase

    return wrapper


@uppercase_decorator
def say_hi():
    return 'hello there'

Related concepts

Decorators — Structure map

Clickable & Draggable!

Decorators — Related pages: