Pergunta de entrevista da empresa Lemon.io

What are python context managers?

Resposta da entrevista

Sigiloso

1 de mar. de 2023

A pratical way to manage critical accesses to a certain functionality. A basic example of it would be to open a file: This can be done by using the "with" statement which, in turn, will use the respective "__enter__" and "__exit__" methods to handle the action of opening and closing a file.

1