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]
name = "pwo"
version = "0.0.2"
version = "0.0.3"
authors = [
{ name="Walter Oggioni", email="oggioni.walter@gmail.com" },
]

View File

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