docs: подробные docstring перед каждой функцией

This commit is contained in:
Repinoid
2026-06-06 07:22:35 +04:00
parent 0de7e0591c
commit 8da4876cb8
5 changed files with 11 additions and 2 deletions
+3
View File
@@ -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