docs: подробные docstring перед каждой функцией
This commit is contained in:
@@ -28,13 +28,16 @@ class Database:
|
||||
self._init_schema()
|
||||
|
||||
def __enter__(self):
|
||||
"""Контекстный менеджер: with Database() as db."""
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
"""Закрытие соединения при выходе из with-блока."""
|
||||
self.close()
|
||||
return False
|
||||
|
||||
def close(self):
|
||||
"""Закрыть соединение с SQLite."""
|
||||
if self.conn:
|
||||
self.conn.close()
|
||||
self.conn = None
|
||||
|
||||
Reference in New Issue
Block a user