3 ms·
> Python doesn't give you the macros needed to write your own for other kinds of resource. Python doesn't use macros, true. But it absolutely gives you the abi
by sago 8y ago
> Python doesn't give you the macros needed to write your own for other kinds of resource.
Python doesn't use macros, true. But it absolutely gives you the ability to do 'with' for other kinds of resource (and anything else). Look for the with-statement and documentation on defining your own context manager.