Skip to content

Commit

Permalink
🩹 Improve type guard for +=
Browse files Browse the repository at this point in the history
Co-authored-by: ddelange <[email protected]>
  • Loading branch information
michen00 and ddelange authored Feb 10, 2024
1 parent bdede4e commit 712771c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/retrie/trie.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __iadd__(
other, # type: "Trie"
): # type: (...) -> "Trie"
"""Merge another Trie object into the current Trie."""
if not isinstance(other, Trie):
if self.__class__ != other.__class__:
raise TypeError(
"Unsupported operand type(s) for +=: '{0}' and '{1}'".format(
type(self), type(other)
Expand Down

0 comments on commit 712771c

Please sign in to comment.