micropython/tests/basics/with_return.py

15 wiersze
227 B
Python

class CtxMgr:
def __enter__(self):
print("__enter__")
return self
def __exit__(self, a, b, c):
print("__exit__", repr(a), repr(b))
def foo():
with CtxMgr():
return 4
print(foo())