Geek Culture
Published in

Geek Culture

Decorator pattern in Python

A structural pattern to add functionality to existing classes.

Photo by laura adai on Unsplash

Decorator pattern is a structural design pattern. It can be used to modify the functionality of an existing class without the need to modify that class.

  • It can add functionality to an object dynamically, even if you do not own that class and cannot easily create a subclass.
  • Similarly, it can limit the…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Martin McBride

Martin McBride

247 Followers

Freelance software consultant, developer, technical author. Java, Python. martinmcbride.org