aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/monads.py
diff options
context:
space:
mode:
authorArun Isaac2022-09-27 23:37:51 +0530
committerArun Isaac2022-09-29 16:15:47 +0530
commit318b86a1e02e39030c0a0e35eb1cd97d427e34d5 (patch)
tree9d6db540469c62e96feb767b336d51c2312fae22 /wqflask/utility/monads.py
parent0776708892493eefa8fc27424e85ea80cabf769b (diff)
downloadgenenetwork2-318b86a1e02e39030c0a0e35eb1cd97d427e34d5.tar.gz
Ignore None values early when initializing MonadicDict.
* wqflask/utility/monads.py (MonadicDict.__init__): Ignore None values early instead of converting them to Nothing and then ignoring them.
Diffstat (limited to 'wqflask/utility/monads.py')
-rw-r--r--wqflask/utility/monads.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wqflask/utility/monads.py b/wqflask/utility/monads.py
index 80ba42c8..e42a60f2 100644
--- a/wqflask/utility/monads.py
+++ b/wqflask/utility/monads.py
@@ -74,8 +74,8 @@ class MonadicDict(UserDict):
converted to monadic values.
"""
if convert:
- super().__init__({key:(Nothing if value is None else Just(value))
- for key, value in d.items()})
+ super().__init__({key:Just(value) for key, value in d.items()
+ if value is not None})
else:
super().__init__(d)
def __getitem__(self, key):