Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobatymo committed Jun 21, 2024
1 parent 2e60ccc commit 77e08f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fuzzycollections/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Fuzzy collections """
"""Fuzzy collections"""

from .fuzzycollections import BkCollection, LinearCollection, SymmetricDeletesCollection

Expand Down
4 changes: 2 additions & 2 deletions fuzzycollections/fuzzycollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def findsorted(self, item: str, max_distance: Optional[int], limit: Optional[int

class LinearCollection(FuzzyCollection):
def __init__(
self, distance_func: Union[str, DistanceFuncMaxT], preprocess_func: Callable[[str], str] = None
self, distance_func: Union[str, DistanceFuncMaxT], preprocess_func: Optional[Callable[[str], str]] = None
) -> None:
self.distance_func = cast("DistanceFuncMaxT", get_distance_func(distance_func, max_distance=True))
self.preprocess_func = get_preprocess_func(preprocess_func)
Expand Down Expand Up @@ -162,7 +162,7 @@ def findsorted(

@staticmethod
def from_view(
collection: List[str], distance_func: Union[str, DistanceFuncMaxT], preprocess_func: Callable = None
collection: List[str], distance_func: Union[str, DistanceFuncMaxT], preprocess_func: Optional[Callable] = None
) -> "LinearCollection":
"""Returns a LinearCollection which operates on a view of another collection.
Preprocess is done each time the collection is queried.
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,22 @@ line-length = 120

[tool.ruff]
line-length = 120
lint.extend-select = [
"B",
"I",
]
lint.ignore = [
"B011",
"B904",
]

[tool.isort]
profile = "black"
line_length = 120

[tool.mypy]
allow_redefinition = true
no_implicit_optional = true
warn_unused_configs = true
warn_unused_ignores = true

Expand Down

0 comments on commit 77e08f4

Please sign in to comment.