Skip to content
Pybites

Pybites

  • Training
  • Certifications
  • Community
  • Code Platform
  • Articles
  • Search

Articles on arguments

Tips

How to Write a Decorator with an Optional Argument?

By Bob Belderbos on 11 April 2017

When playing with decorators (this week’s challenge) I got stuck: how do you write a decorator that takes an optional argument? Python cookbook 3rd ed edition to the rescue. In this post how I failed my way to the right solution.

PDM Program

  • Log In
  • About PDM

PyBites

  • Catalogue
  • Podcast
  • Articles
  • Platform
  • Community
  • Shop

Resources

  • About Us
  • Contact Us
  • Sitemap
  • Privacy Policy

Mailing List

Subscribe to our mailing list and receive the PyBites Effective Developer Package for free.

  • Twitter
  • LinkedIn
  • Facebook
  • YouTube
  • Github
  • RSS
Powered by coffee, © 2025 PyBites.