mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 04:09:05 +00:00
style(python): format with black
This commit is contained in:
parent
454224858b
commit
08ad656240
17 changed files with 208 additions and 36 deletions
|
@ -4,14 +4,18 @@ class Array(list):
|
|||
return Array(list(set(self)))
|
||||
else:
|
||||
removes = []
|
||||
for (lhs, rhs) in zip(self, self[1:]):
|
||||
for lhs, rhs in zip(self, self[1:]):
|
||||
if same_bucket(lhs, rhs):
|
||||
removes.append(lhs)
|
||||
for remove in removes:
|
||||
self.remove(remove)
|
||||
return self
|
||||
|
||||
def push(self, value):
|
||||
self.append(value)
|
||||
return self
|
||||
|
||||
def partition(self, f):
|
||||
return Array(list(filter(f, self))), Array(list(filter(lambda x: not f(x), self)))
|
||||
return Array(list(filter(f, self))), Array(
|
||||
list(filter(lambda x: not f(x), self))
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue