This commit is contained in:
@@ -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" },
|
||||||
]
|
]
|
||||||
|
@@ -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:
|
||||||
|
Reference in New Issue
Block a user