dimanche 29 mai 2022

Enforce the use of context manager?

I have a custom resource defined as a class and a context manager to manage that resource. This combination is working perfectly. Is there any way to enforce that the resource will be used through context manager only and if anything is there then is that Pythonic?

Aucun commentaire:

Enregistrer un commentaire