sqlite-utils icon indicating copy to clipboard operation
sqlite-utils copied to clipboard

`db.close()` doesn't have a type hint

Open alexwlchan opened this issue 10 months ago • 0 comments

As in the title; I'm going to send a PR to fix this as soon as I open the issue, because it's a one-line change.

Steps to reproduce

Consider the following example program:

from sqlite_utils import Database

db = Database("example.db")
db.close()

which fails type checking if I'm running mypy in strict mode:

$ mypy --strict noclose.py
noclose.py:4: error: Call to untyped function "close" in typed context  [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)

$ mypy --version
mypy 1.16.0 (compiled: yes)

$ sqlite-utils --version
sqlite-utils, version 3.38

I run mypy in strict mode, and I'm bored of having to annotate my close() calls with type: ignore.

alexwlchan avatar Jun 13 '25 12:06 alexwlchan