fixed bug in Maybe.value
All checks were successful
CI / build (push) Successful in 11s

This commit is contained in:
2024-09-10 00:04:30 +08:00
parent e89e306e96
commit 4bddc35633
2 changed files with 3 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "pwo" name = "pwo"
version = "0.0.2" version = "0.0.3"
authors = [ authors = [
{ name="Walter Oggioni", email="oggioni.walter@gmail.com" }, { name="Walter Oggioni", email="oggioni.walter@gmail.com" },
] ]

View File

@@ -24,11 +24,10 @@ class Maybe(Generic[T]):
@property @property
def value(self) -> T: def value(self) -> T:
value = self._value if self.is_empty:
if not value:
raise ValueError('Empty Maybe') raise ValueError('Empty Maybe')
else: else:
return value return self._value
@property @property
def is_present(self) -> bool: def is_present(self) -> bool: