oqueeh
.net
All topics
>
Python
What are __enter__ and __exit__ functions in Python
Manage the usage of resources which need to be freed.
__enter__
allocates the resource
__exit__
release the resource
Notes:
Can be used to create code-blocks in which a context is valid.