AT
Size: a a a
AT
AT
БГ
context = next(with_replacement)()
try:
# тело with
finally:
next(with_replacement)()
БГ
БГ
AT
БГ
БГ
AT
AT
БГ
👑️
class with_for:
def __init__(self, it):
self.it = iter(it)
def __enter__(self):
return self
def next(self):
return next(self.it)
def __exit__(self, exc_type, exc_val, exc_tb):
return True
👑️
БГ
AT
👑️
👑️
БГ
class with_for:
def __init__(self, it):
self.it = iter(it)
def __enter__(self):
return self
def next(self):
return next(self.it)
def __exit__(self, exc_type, exc_val, exc_tb):
return True