mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 12:14:43 +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,22 +4,27 @@ def if__(cond, then, else_=lambda: None):
|
|||
else:
|
||||
return else_()
|
||||
|
||||
|
||||
def for__(iterable, body):
|
||||
for i in iterable:
|
||||
body(i)
|
||||
|
||||
|
||||
def while__(cond_block, body):
|
||||
while cond_block():
|
||||
body()
|
||||
|
||||
|
||||
def with__(obj, body):
|
||||
obj.__enter__()
|
||||
body(obj)
|
||||
obj.__exit__()
|
||||
|
||||
|
||||
def discard__(obj):
|
||||
pass
|
||||
|
||||
|
||||
def then__(x, f):
|
||||
if x == None or x == NotImplemented:
|
||||
return x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue