Skip to content

Commit

Permalink
Use type alias for Mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunedan committed Jun 25, 2024
1 parent f7c05c2 commit 12041aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions simplemma/strategies/dictionaries/dictionary_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
"""

from __future__ import annotations

import lzma
import pickle
from abc import abstractmethod
from collections.abc import Mapping
from functools import lru_cache
from os import listdir, path
from pathlib import Path
from typing import ByteString, Dict, Protocol
from typing import Mapping

DATA_FOLDER = str(Path(__file__).parent / "data")
SUPPORTED_LANGUAGES = [
Expand Down
8 changes: 3 additions & 5 deletions simplemma/strategies/dictionaries/trie_directory_factory.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from __future__ import annotations

import logging
from collections.abc import Mapping, MutableMapping
from collections.abc import MutableMapping
from functools import lru_cache
from pathlib import Path
from typing import Optional
from typing import List, Mapping, Optional

from marisa_trie import BytesTrie, HUGE_CACHE # type: ignore[import-not-found]
from platformdirs import user_cache_dir
Expand Down Expand Up @@ -51,7 +49,7 @@ class TrieDictionaryFactory(DictionaryFactory):
lookup performance isn't as good as with dicts.
"""

__slots__: list[str] = []
__slots__: List[str] = []

def __init__(
self,
Expand Down

0 comments on commit 12041aa

Please sign in to comment.