mirror of
https://github.com/correl/typesafe-monads.git
synced 2025-03-31 17:00:17 -09:00
better coverage and oop
This commit is contained in:
parent
8f94d330b2
commit
b506b9a403
2 changed files with 3 additions and 6 deletions
|
@ -120,9 +120,6 @@ class Just(Maybe[T]):
|
|||
def __repr__(self) -> str: # pragma: no cover
|
||||
return f"<Just {self.value}>"
|
||||
|
||||
def __sizeof__(self) -> int:
|
||||
return 1
|
||||
|
||||
def __len__(self) -> int:
|
||||
return 1
|
||||
|
||||
|
@ -151,9 +148,6 @@ class Nothing(Maybe[T]):
|
|||
def __repr__(self) -> str: # pragma: no cover
|
||||
return "<Nothing>"
|
||||
|
||||
def __sizeof__(self) -> int:
|
||||
return 0
|
||||
|
||||
def __len__(self) -> int:
|
||||
return 0
|
||||
|
||||
|
|
|
@ -155,3 +155,6 @@ def test_flatten() -> None:
|
|||
m_empty: Maybe[Maybe[str]] = Just(Nothing())
|
||||
m_flat: Maybe[str] = m_empty.flatten()
|
||||
assert m_flat.or_else("backup") == "backup"
|
||||
|
||||
m_full: Maybe[Maybe[str]] = Just(Just("becon"))
|
||||
assert m_full.flatten().or_else("backup") == "becon"
|
||||
|
|
Loading…
Add table
Reference in a new issue