Skip to content

Commit dca7513

Browse files
committed
Make the code formatter happy
1 parent 6b01e00 commit dca7513

File tree

6 files changed

+7
-20
lines changed

6 files changed

+7
-20
lines changed

hashtable/02_linear_probing/hashtable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ def get(self, key, default=None):
9696
@property
9797
def pairs(self):
9898
return {
99-
pair for pair in self._slots.copy()
100-
if pair not in (None, DELETED)
99+
pair for pair in self._slots.copy() if pair not in (None, DELETED)
101100
}
102101

103102
@property

hashtable/03_autoresize/hashtable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def get(self, key, default=None):
9797
@property
9898
def pairs(self):
9999
return {
100-
pair for pair in self._slots.copy()
101-
if pair not in (None, DELETED)
100+
pair for pair in self._slots.copy() if pair not in (None, DELETED)
102101
}
103102

104103
@property

hashtable/04_load_factor/hashtable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ def get(self, key, default=None):
101101
@property
102102
def pairs(self):
103103
return {
104-
pair for pair in self._slots.copy()
105-
if pair not in (None, DELETED)
104+
pair for pair in self._slots.copy() if pair not in (None, DELETED)
106105
}
107106

108107
@property

hashtable/04_load_factor/test_hashtable.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def test_should_not_create_hashtable_with_negative_load_factor_threshold():
5050

5151

5252
def test_should_create_hashtable_with_one_load_factor_threshold():
53-
assert (
54-
HashTable(load_factor_threshold=1)._load_factor_threshold == 1
55-
)
53+
assert HashTable(load_factor_threshold=1)._load_factor_threshold == 1
5654

5755

5856
def test_should_not_create_hashtable_with_load_factor_threshold_above_one():

hashtable/05_separate_chaining/test_hashtable.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ def test_should_not_create_hashtable_with_negative_load_factor_threshold():
5151

5252

5353
def test_should_create_hashtable_with_one_load_factor_threshold():
54-
assert (
55-
HashTable(load_factor_threshold=1)._load_factor_threshold == 1
56-
)
54+
assert HashTable(load_factor_threshold=1)._load_factor_threshold == 1
5755

5856

5957
def test_should_not_create_hashtable_with_load_factor_threshold_above_one():

hashtable/06_insertion_order/test_hashtable.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ def test_should_not_create_hashtable_with_negative_load_factor_threshold():
5050

5151

5252
def test_should_create_hashtable_with_one_load_factor_threshold():
53-
assert (
54-
HashTable(load_factor_threshold=1)._load_factor_threshold == 1
55-
)
53+
assert HashTable(load_factor_threshold=1)._load_factor_threshold == 1
5654

5755

5856
def test_should_not_create_hashtable_with_load_factor_threshold_above_one():
@@ -171,11 +169,7 @@ def test_should_update_value(hash_table):
171169

172170

173171
def test_should_return_pairs(hash_table):
174-
assert hash_table.pairs == [
175-
("hola", "hello"),
176-
(98.6, 37),
177-
(False, True)
178-
]
172+
assert hash_table.pairs == [("hola", "hello"), (98.6, 37), (False, True)]
179173

180174

181175
def test_should_get_pairs_of_empty_hash_table():

0 commit comments

Comments
 (0)