What You Probably Don't Know About Python Decorators

Written by regquerlyvalueex | Published 2019/10/31
Tech Story Tags: python-tips | python | python-learn | one-weird-trick | software-development | latest-tech-stories | programming-interviews | python-programming

TLDR A python decorator is a special kind of function that either takes a function and returns a class, or takes a class. A decorator pattern wraps an object and dynamically adds some functionality to it. Decorators provide a flexible alternative to inheritance for extending functionality. Any callable can be used as decorator, including functions, methods, functors and functions. A lot of people underestimate the power of decorators in python, because they have the same name, but can do a lot more.via the TL;DR App

no story

Written by regquerlyvalueex | Python developer
Published by HackerNoon on 2019/10/31