We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af6fc3e commit e0b0061Copy full SHA for e0b0061
patterns/behavioral/strategy.py
@@ -55,9 +55,8 @@ def apply_discount(self) -> float:
55
return self.price - discount
56
57
def __repr__(self) -> str:
58
- return f"""
59
- <Order price: {self.price} with discount strategy: {getattr(self.discount_strategy, '__name__', None)}>
60
- """
+ strategy = getattr(self.discount_strategy, '__name__', None)
+ return f"<Order price: {self.price} with discount strategy: {strategy}>"
61
62
63
def ten_percent_discount(order: Order) -> float:
0 commit comments