• Code Maven
  • Slides
  • About
  • Press ? for keyboard navigation
  • Atom feed
(<-) Decorator A recursive Fibonacci (->)

Python: Use cases for decorators in Python


  • Logging calls with parameters.
  • Logging elapsed time of calls.
  • Access control in Django or other web frameworks. (e.g. login required)
  • Memoization (caching)
  • Retry
  • Function timeout
  • Locking for thread safety
  • Decorator Library

  • Table of Contents (t)
  • Indexed keywords (k)

  • Copyright 2017 Gabor Szabo
  • Last updated at 2019-02-17T06:56:04