Skip to content

Instantly share code, notes, and snippets.

View fwarren's full-sized avatar

Fred Warren fwarren

View GitHub Profile
@fwarren
fwarren / withsqlite.py
Last active April 25, 2024 19:47
Simple sqlite3 context manager for Python 3 will type annotations
#!/usr/bin/env python
"""Open Sqlite3 databae with context manager"""
from pathlib import Path
from types import TracebackType
from typing import overload, Any, Optional, Union
class dbopen(): # pylint: disable=invalid-name
"""Simple context manager for sqlite3 databases"""