diff --git a/solid-principles-python/README.md b/solid-principles-python/README.md index 9e5a64f5e8..e6ea5873c0 100644 --- a/solid-principles-python/README.md +++ b/solid-principles-python/README.md @@ -1,3 +1,3 @@ -# SOLID Principles: Improve Object-Oriented Design in Python +# SOLID Design Principles: Improve Object-Oriented Code in Python -This folder provides the code examples for the Real Python tutorial [SOLID Principles: Improve Object-Oriented Design in Python](https://realpython.com/solid-principles-python/). +This folder contains the code examples for the Real Python article [SOLID Design Principles: Improve Object-Oriented Code in Python](https://realpython.com/solid-principles-python/). \ No newline at end of file diff --git a/solid-principles-python/shapes_ocp.py b/solid-principles-python/shapes_ocp.py index 6392260e0b..e0154e3384 100644 --- a/solid-principles-python/shapes_ocp.py +++ b/solid-principles-python/shapes_ocp.py @@ -10,12 +10,16 @@ # self.height = kwargs["height"] # elif self.shape_type == "circle": # self.radius = kwargs["radius"] +# else: +# raise TypeError("Unsupported shape type") # def calculate_area(self): # if self.shape_type == "rectangle": # return self.width * self.height # elif self.shape_type == "circle": # return pi * self.radius**2 +# else: +# raise TypeError("Unsupported shape type") # Good example