Skip to content

row_factory does not support sqlite3.Row in cursor #15072

@scratchmex

Description

@scratchmex

pylance throws this problem

Cannot assign to attribute "row_factory" for class "Cursor"
  Type "type[Row]" is not assignable to type "((Cursor, Row) -> object) | None"

despite in the sqlite docs says that

Can be set to the included sqlite3.Row; or a callable that accepts two arguments, a Cursor object and the tuple of row values, and returns a custom object representing an SQLite row.

ref: https://docs.python.org/3.14/library/sqlite3.html#sqlite3.Cursor.row_factory

I'm going to do a PR

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