1 2 3 4 5 6 7 8 9 10 11 12 13
def do_something(x: int): print(f"hello world {x}") my_resource: int = 10 with my_resource as other: do_something(other) with my_resource as yet_another: do_something(yet_another) with my_resource: do_something(my_resource)