Skip to content

Commit f5890ea

Browse files
lpozobzaczynski
andauthored
Update the sample code for the SOLID article (#709)
Co-authored-by: Bartosz Zaczyński <[email protected]>
1 parent 87935df commit f5890ea

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

solid-principles-python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# SOLID Principles: Improve Object-Oriented Design in Python
1+
# SOLID Design Principles: Improve Object-Oriented Code in Python
22

3-
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/).
3+
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/).

solid-principles-python/shapes_ocp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
# self.height = kwargs["height"]
1111
# elif self.shape_type == "circle":
1212
# self.radius = kwargs["radius"]
13+
# else:
14+
# raise TypeError("Unsupported shape type")
1315

1416
# def calculate_area(self):
1517
# if self.shape_type == "rectangle":
1618
# return self.width * self.height
1719
# elif self.shape_type == "circle":
1820
# return pi * self.radius**2
21+
# else:
22+
# raise TypeError("Unsupported shape type")
1923

2024

2125
# Good example

0 commit comments

Comments
 (0)