Skip to content

Commit

Permalink
use slots for dataclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Mar 15, 2024
1 parent d13f6f3 commit 7ffc08b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyglossary/glossary_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
# ]


@dataclass(frozen=True)
@dataclass(slots=True, frozen=True)
class ConvertArgs:
inputFilename: str
inputFormat: str = ""
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/plugins/appledict_bin/appledict_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__all__ = ["AppleDictProperties", "from_metadata"]


@dataclass
@dataclass(slots=True)
class AppleDictProperties:
# in plist file: "IDXDictionaryVersion"
# values := (1 | 2 | 3)
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/plugins/babylon_bgl/bgl_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
__all__ = ["BabylonLanguage", "languageByCode"]


@dataclass
@dataclass(slots=True)
class BabylonLanguage:

"""
Expand Down
1 change: 0 additions & 1 deletion pyglossary/plugins/quickdic6.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ def _without_dash(a: str) -> str:
return a.replace("-", "").replace("þ", "th").replace("Þ", "Th")


# TODO: switch to dataclass
class QuickDic:
def __init__( # noqa: PLR0913
self,
Expand Down
2 changes: 1 addition & 1 deletion pyglossary/sort_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class NamedSortKey(NamedTuple):
sqlite: "sqliteSortKeyType"


@dataclass
@dataclass(slots=True)
class LocaleNamedSortKey:
name: str
desc: str
Expand Down
2 changes: 1 addition & 1 deletion scripts/wiktextract/extract-schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any


@dataclass
@dataclass(slots=True)
class Node:
Type: str = ""

Expand Down

0 comments on commit 7ffc08b

Please sign in to comment.