Skip to content

Commit

Permalink
fix: tweak typing for merge implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Jan 10, 2021
1 parent eb3eaf7 commit 8efa444
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions beet/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@

K = TypeVar("K")
V = TypeVar("V")
MergeableType = TypeVar("MergeableType", bound="SupportsMerge[Any]")
MergeableType = TypeVar("MergeableType", bound="SupportsMerge")
ProxyKeyType = TypeVar("ProxyKeyType")

PinDefault = Union[V, Sentinel]
PinDefaultFactory = Union[Callable[[], V], Sentinel]


class SupportsMerge(Protocol[V]):
class SupportsMerge(Protocol):
"""Protocol for detecting mergeable types."""

def merge(self: V, other: V) -> bool:
def merge(self, other: Any) -> bool:
...


Expand Down
2 changes: 1 addition & 1 deletion beet/library/data_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class TagFile(JsonFile, NamespaceFile):

extension = ".json"

def merge(self: TagFileType, other: TagFileType) -> bool:
def merge(self: TagFileType, other: TagFileType) -> bool: # type: ignore
if other.data.get("replace"):
self.data["replace"] = True

Expand Down

0 comments on commit 8efa444

Please sign in to comment.