What is a decorator in Python?

Publicado el: 13 junio 2022
en el canal de: Python Morsels
572
33

A decorator is a callable (usually a function though sometimes a class) that accepts either a function or a class and returns a new function or class that wraps around the original one.

Read an article version of this video at https://pym.dev/what-is-a-decorator/

Find more Python screencasts at https://pym.dev/screencasts/

00:00 Decorators accept a function and return a function
01:30 The decorator syntax: using the @ symbol to apply decorators
02:42 Decorator functions, decorator classes, function decorators, and class decorators
03:06 Decorators can be implemented using classes too
03:45 Class decorators decorate classes
04:23 Recap


En esta página del sitio puede ver el video en línea What is a decorator in Python? de Duración hora minuto segunda en buena calidad , que subió el usuario Python Morsels 13 junio 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 572 veces y le gustó 33 a los espectadores. Disfruta viendo!