zivid-python icon indicating copy to clipboard operation
zivid-python copied to clipboard

Common way of adding context manager + release to classes

Open trym-b opened this issue 6 years ago • 0 comments

__enter__, __exit__, __del__ and release are duplicated in many of the classes in modules/zivid

This could be fixed by adding, for example, and decorator:

@utils.context_manager
class SomethingThatRequiresContextManager:
    ....

trym-b avatar Nov 12 '19 11:11 trym-b