Skip to content

Commit bffbeb7

Browse files
committed
OrderedSet.reverse: Require key and reverse to be kwargs
Technically, this is a breaking change. However, use as a positional argument was never supposed to be allowed in the first place. Caught by flake8-boolean-trap via `ruff check`
1 parent e43dc3d commit bffbeb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/techcable/orderedset/_orderedset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def __gt__(self, other: object) -> bool:
206206
def __ge__(self, other: object) -> bool:
207207
return self._impl_cmp_op(other, operator.ge)
208208

209-
def sort(self, key: Optional[Callable[[T], U]] = None, reverse: bool = False) -> None:
209+
def sort(self, *, key: Callable[[T], U] | None = None, reverse: bool = False) -> None:
210210
"""Sort the elements in the set, as if calling list.sort"""
211211
self._elements.sort(key=key, reverse=reverse)
212212

0 commit comments

Comments
 (0)