Brainwave
Published in

Brainwave

How to Write Clean PYTHONIC Code With SOLID Principle #2

Simple Implementation of Open-Closed Principle in Python

Designed on Canva

In an earlier post, you’ve seen how to implement the Open-Closed Principle (OCP) in Python.

In this post, I’m trying to solve an issue introduced in the earlier post. You’ll see a simpler implementation of that SOLID principle to be a Pythonic

--

--

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