Skip to content

Commit 68e62a9

Browse files
committed
Type checked chain of responsibility pattern
1 parent 055edfa commit 68e62a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

patterns/behavioral/chain_of_responsibility.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ConcreteHandler1(Handler):
6565

6666
def check_range(self, request: int) -> Optional[bool]:
6767
if self.start <= request < self.end:
68-
print("request {} handled in handler 1".format(request))
68+
print(f"request {request} handled in handler 1")
6969
return True
7070

7171

@@ -75,7 +75,7 @@ class ConcreteHandler2(Handler):
7575
def check_range(self, request: int) -> Optional[bool]:
7676
start, end = self.get_interval_from_db()
7777
if start <= request < end:
78-
print("request {} handled in handler 2".format(request))
78+
print(f"request {request} handled in handler 2")
7979
return True
8080

8181
@staticmethod

0 commit comments

Comments
 (0)