What You Probably Don't Know About Python Decoratorsby@regquerlyvalueex
4,401 reads

What You Probably Don't Know About Python Decorators

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

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.

Company Mentioned

Mention Thumbnail
featured image - What You Probably Don't Know About Python Decorators
Alex Zaiets HackerNoon profile picture

@regquerlyvalueex

Alex Zaiets

Python developer


Receive Stories from @regquerlyvalueex

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!