4259 links
  • Arnaud's links
  • Home
  • RSS Feed
  • Tag cloud
  • Login
search: tag:decorators — newest first
  • Regardez "Reuven M. Lerner - Practical decorators - PyCon 2019" sur YouTube

    You want to really understand decorators? Watch this video!

    boilerplate:

    import functools
    
    def decorator(func):
        @functools.wraps(func)
        def wrapper_decorator(*args, **kwargs):
            # Do something before
            value = func(*args, **kwargs)
            # Do something after
            return value
        return wrapper_decorator
    
    • https://realpython.com/primer-on-python-decorators/
    February 11, 2022 - permalink - https://youtu.be/MjHpMCIvwsY
    decorators python