Skip to content

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

@alexwlchan

Description

@alexwlchan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions