Skip to content

Commit

Permalink
Make all one-element __slots__ be tuples
Browse files Browse the repository at this point in the history
Most already were, but a few were strings.
  • Loading branch information
EliahKagan committed Oct 22, 2023
1 parent f78587f commit 0327f8f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion git/index/typ.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BlobFilter:
The given paths are given relative to the repository.
"""

__slots__ = "paths"
__slots__ = ("paths",)

def __init__(self, paths: Sequence[PathLike]) -> None:
"""
Expand Down
5 changes: 3 additions & 2 deletions git/objects/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class TreeModifier:
the cache of a tree, will be sorted. This ensures it will be in a serializable state.
"""

__slots__ = "_cache"
__slots__ = ("_cache",)

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

type: Literal["tree"] = "tree"
__slots__ = "_cache"

__slots__ = ("_cache",)

# Actual integer IDs for comparison.
commit_id = 0o16 # Equals stat.S_IFDIR | stat.S_IFLNK - a directory link.
Expand Down
2 changes: 1 addition & 1 deletion git/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def update(
class CallableRemoteProgress(RemoteProgress):
"""An implementation forwarding updates to any callable."""

__slots__ = "_callable"
__slots__ = ("_callable",)

def __init__(self, fn: Callable) -> None:
self._callable = fn
Expand Down

0 comments on commit 0327f8f

Please sign in to comment.