circuitpython/tests/basics/with-return.py

15 lines
227 B
Python
Raw Normal View History

2014-03-28 22:11:24 -04:00
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())