Skip to content

Commit 32b187b

Browse files
committed
black formatting, readme
1 parent a3b624d commit 32b187b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

chapter04_factory/pizza_abstract_factory.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ def __str__(self):
213213
result.append(self.cheese)
214214

215215
if self.veggies:
216-
result.append(", ".join(map(str,self.veggies)))
216+
result.append(", ".join(map(str, self.veggies)))
217217

218218
if self.clam:
219219
result.append(self.clam)
220220

221221
if self.pepperoni:
222222
result.append(self.pepperoni)
223-
224-
return "\n".join(map(str, result))+"\n"
223+
224+
return "\n".join(map(str, result)) + "\n"
225225

226226

227227
class CheesePizza(Pizza):
@@ -338,4 +338,4 @@ def pizza_test_drive():
338338

339339

340340
if __name__ == "__main__":
341-
pizza_test_drive()
341+
pizza_test_drive()

chapter04_factory/readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
**Simple Factory**: A class which chooses which product class to instantiate and return, based upon method parameters.
44

5-
**Factory Method**: Define an interface for creating an object, but let subclasses decide which class to instantiate. The Factory method lets a class defer instantiation it uses to subclasses.
5+
**Factory Method**: Defines an interface for creating an object, but lets subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses.
66

7-
**Abstract Factory**: Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
7+
For instance the `PizzaStore` abstract class in this repo provides an abstract `create_pizza` interface for creating one product.
8+
9+
**Abstract Factory**: Provides an interface for creating families of related or dependent objects without specifying their concrete classes.
10+
11+
For instance the `PizzaIngredientFactory` abstract class defines an interface for a family of products.

0 commit comments

Comments
 (0)