Python for Data Engineers: Using Function Decorators

Поделиться
HTML-код
  • Опубликовано: 14 июн 2023
  • Function decorators are like inheritance for Python functions. They let you easily add functionality to existing functions without changing the decorated function. And they are used in many popular Python frameworks including Django, Flask, and even Databricks. Learn what decorators are, how to use them, and how to write your own!
    Patreon Community and Watch this Video without Ads!
    www.patreon.com/bePatron?u=63...
    Demo Jupyter Notebook available at:
    github.com/bcafferky/shared/b...
  • НаукаНаука

Комментарии • 7

  • @user-wy6fd2kw8y
    @user-wy6fd2kw8y Год назад +1

    Great and super useful series! Appreciate it so much as a DE beginner, looking forward to the next one.

  • @marcin2x4
    @marcin2x4 11 месяцев назад

    A must for me to check. I'm trying to grasp usage of functools in decorators.

  • @frag_it
    @frag_it Год назад +1

    Do you have a playlist for python for data engineering?

    • @BryanCafferky
      @BryanCafferky  11 месяцев назад

      Just started it here ruclips.net/p/PL7_h0bRfL52qOdwqGlXd9nN4J0sauPssL

  • @rajarams3722
    @rajarams3722 11 месяцев назад

    Superb ! Thanks ! One question...Even if I comment out the @wraps, it is working the same..Can you please explain the wraps ?

  • @rydmerlin
    @rydmerlin Год назад +1

    @lru_cache is the one I’m most familiar with. Does the decorator have to be on it’s own line or can I just search and replace def with @decorator def. Similar to how Java annotations can be on the same line as the thing they are annotating.

    • @BryanCafferky
      @BryanCafferky  Год назад

      Not sure but I would strongly recommend putting the decorator on its own line. It's more readable and therefore more Pythonic. Mushing lines together is a bad idea and I still have nightmares of the old BASIC program days when lines were all crammed together. :-)