Skip to content

Commit b696d81

Browse files
committed
Flake8 warnings
1 parent b7c1e16 commit b696d81

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

cycler/__init__.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
from __future__ import annotations
4545

46-
from collections.abc import Hashable, Iterable, Callable
46+
from collections.abc import Hashable, Iterable
4747
import copy
4848
from functools import reduce
4949
from itertools import product, cycle
@@ -201,15 +201,11 @@ def change_key(self, old: K, new: K) -> None:
201201
return
202202
if new in self._keys:
203203
raise ValueError(
204-
"Can't replace {old} with {new}, {new} is already a key".format(
205-
old=old, new=new
206-
)
204+
f"Can't replace {old} with {new}, {new} is already a key"
207205
)
208206
if old not in self._keys:
209207
raise KeyError(
210-
"Can't replace {old} with {new}, {old} is not a key".format(
211-
old=old, new=new
212-
)
208+
f"Can't replace {old} with {new}, {old} is not a key"
213209
)
214210

215211
self._keys.remove(old)
@@ -310,7 +306,9 @@ def __mul__(self, other: Cycler[K, V] | int) -> Cycler[K, V]:
310306
return Cycler(self, other, product)
311307
elif isinstance(other, int):
312308
trans = self.by_key()
313-
return reduce(add, (_cycler(k, v * other) for k, v in trans.items()))
309+
return reduce(
310+
add, (_cycler(k, v * other) for k, v in trans.items())
311+
)
314312
else:
315313
return NotImplemented
316314

0 commit comments

Comments
 (0)