Skip to content

Commit 0327f8f

Browse files
committed
Make all one-element __slots__ be tuples
Most already were, but a few were strings.
1 parent f78587f commit 0327f8f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Diff for: git/index/typ.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class BlobFilter:
4040
The given paths are given relative to the repository.
4141
"""
4242

43-
__slots__ = "paths"
43+
__slots__ = ("paths",)
4444

4545
def __init__(self, paths: Sequence[PathLike]) -> None:
4646
"""

Diff for: git/objects/tree.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class TreeModifier:
109109
the cache of a tree, will be sorted. This ensures it will be in a serializable state.
110110
"""
111111

112-
__slots__ = "_cache"
112+
__slots__ = ("_cache",)
113113

114114
def __init__(self, cache: List[TreeCacheTup]) -> None:
115115
self._cache = cache
@@ -214,7 +214,8 @@ class Tree(IndexObject, git_diff.Diffable, util.Traversable, util.Serializable):
214214
"""
215215

216216
type: Literal["tree"] = "tree"
217-
__slots__ = "_cache"
217+
218+
__slots__ = ("_cache",)
218219

219220
# Actual integer IDs for comparison.
220221
commit_id = 0o16 # Equals stat.S_IFDIR | stat.S_IFLNK - a directory link.

Diff for: git/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ def update(
713713
class CallableRemoteProgress(RemoteProgress):
714714
"""An implementation forwarding updates to any callable."""
715715

716-
__slots__ = "_callable"
716+
__slots__ = ("_callable",)
717717

718718
def __init__(self, fn: Callable) -> None:
719719
self._callable = fn

0 commit comments

Comments
 (0)