Skip to content

Commit 11113ea

Browse files
committed
linter updates - changes to comply with black
1 parent 53ba9bc commit 11113ea

File tree

13 files changed

+9
-14
lines changed

13 files changed

+9
-14
lines changed

Diff for: patterns/behavioral/catalog.py

-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def main_method(self) -> None:
4646

4747
# Alternative implementation for different levels of methods
4848
class CatalogInstance:
49-
5049
"""catalog of multiple methods that are executed depending on an init
5150
5251
parameter
@@ -82,7 +81,6 @@ def main_method(self) -> None:
8281

8382

8483
class CatalogClass:
85-
8684
"""catalog of multiple class methods that are executed depending on an init
8785
8886
parameter
@@ -121,7 +119,6 @@ def main_method(self):
121119

122120

123121
class CatalogStatic:
124-
125122
"""catalog of multiple static methods that are executed depending on an init
126123
127124
parameter

Diff for: patterns/behavioral/iterator_alt.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*TL;DR
55
Traverses a container and accesses the container's elements.
66
"""
7+
78
from __future__ import annotations
89

910

Diff for: patterns/behavioral/memento.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Provides the ability to restore an object to its previous state.
66
"""
77

8-
from typing import Callable, List
98
from copy import copy, deepcopy
9+
from typing import Callable, List
1010

1111

1212
def memento(obj, deep=False):

Diff for: patterns/behavioral/publish_subscribe.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
Author: https://github.com/HanWenfang
55
"""
66

7-
87
from __future__ import annotations
98

109

Diff for: patterns/behavioral/strategy.py

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
Enables selecting an algorithm at runtime.
88
"""
99

10-
1110
from __future__ import annotations
1211

1312
from typing import Callable

Diff for: patterns/creational/abstract_factory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def __str__(self) -> str:
6262

6363

6464
class PetShop:
65-
6665
"""A pet shop"""
6766

6867
def __init__(self, animal_factory: Type[Pet]) -> None:
@@ -80,6 +79,7 @@ def buy_pet(self, name: str) -> Pet:
8079

8180
# Additional factories:
8281

82+
8383
# Create a random animal
8484
def random_animal(name: str) -> Pet:
8585
"""Let's be dynamic!"""

Diff for: patterns/creational/borg.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
*TL;DR
3333
Provides singleton-like behavior sharing state between instances.
3434
"""
35+
3536
from typing import Dict
3637

3738

Diff for: patterns/creational/factory.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
*TL;DR
2222
Creates objects without having to specify the exact class.
2323
"""
24-
from typing import Dict
25-
from typing import Protocol
26-
from typing import Type
24+
25+
from typing import Dict, Protocol, Type
2726

2827

2928
class Localizer(Protocol):
@@ -50,7 +49,6 @@ def localize(self, msg: str) -> str:
5049

5150

5251
def get_localizer(language: str = "English") -> Localizer:
53-
5452
"""Factory"""
5553
localizers: Dict[str, Type[Localizer]] = {
5654
"English": EnglishLocalizer,

Diff for: patterns/creational/prototype.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*TL;DR
2121
Creates new object instances by cloning prototype.
2222
"""
23+
2324
from __future__ import annotations
2425

2526
from typing import Any

Diff for: patterns/other/blackboard.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
99
https://en.wikipedia.org/wiki/Blackboard_system
1010
"""
11+
1112
from __future__ import annotations
1213

1314
import abc

Diff for: patterns/other/graph_search.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class GraphSearch:
2-
32
"""Graph search emulation in python, from source
43
http://www.python.org/doc/essays/graphs/
54

Diff for: tests/behavioral/test_strategy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from patterns.behavioral.strategy import Order, ten_percent_discount, on_sale_discount
3+
from patterns.behavioral.strategy import Order, on_sale_discount, ten_percent_discount
44

55

66
@pytest.fixture

Diff for: tests/creational/test_pool.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def test_frozen_pool(self):
2929

3030

3131
class TestNaitivePool(unittest.TestCase):
32-
3332
"""def test_object(queue):
3433
queue_object = QueueObject(queue, True)
3534
print('Inside func: {}'.format(queue_object.object))"""

0 commit comments

Comments
 (0)