Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions solid-principles-python/README.md
Original file line number Diff line number Diff line change
@@ -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/).
4 changes: 4 additions & 0 deletions solid-principles-python/shapes_ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down