Skip to content

Commit

Permalink
copy magic methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wusteven815 committed Nov 12, 2024
1 parent f5744dd commit 8785672
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugins/ui/src/deephaven/ui/types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,21 @@ class DateRange(TypedDict):


class _Undefined:
def __str__(self) -> str:
return "Undefined"

def __bool__(self) -> bool:
return False

def __copy__(self) -> "_Undefined":
return self

def __deepcopy__(self, _: Any) -> "_Undefined":
return self

def __eq__(self, other: object) -> bool:
return isinstance(other, _Undefined) or other is None

def __str__(self) -> str:
return "Undefined"


Undefined = _Undefined()
UndefinedType: TypeAlias = _Undefined

0 comments on commit 8785672

Please sign in to comment.