fix: dict update! bug

This commit is contained in:
Shunsuke Shibayama 2023-10-14 21:38:12 +09:00
parent a8c1113df7
commit 0a24c0cb77
15 changed files with 97 additions and 23 deletions

View file

@ -123,6 +123,9 @@ class NatMut(IntMut): # and Nat
def __pos__(self):
return self
def update(self, f):
self.value = Nat(f(self.value))
def try_new(i): # -> Result[Nat]
if i >= 0:
return NatMut(i)