mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 12:14:43 +00:00
fix: dict update!
bug
This commit is contained in:
parent
a8c1113df7
commit
0a24c0cb77
15 changed files with 97 additions and 23 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue