mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
feat: add Array.update_nth!
This commit is contained in:
parent
07e37c878c
commit
74bca70017
7 changed files with 87 additions and 15 deletions
|
@ -69,3 +69,6 @@ class Array(list):
|
|||
if not contains_operator(elem_t, elem):
|
||||
return False
|
||||
return True
|
||||
|
||||
def update_nth(self, index, f):
|
||||
self[index] = f(self[index])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue