This seems a mypy shortcoming fixed in 0.950 as the CI didn't complain.
The row factory definition was exotic but arguably correct. Not worth
bumping up the min version for it anyway.
cur = conn.execute("select 'a' as ve")
assert cur.fetchone() == ["Ave"]
- with conn.cursor(row_factory=lambda c: set) as cur1:
+ with conn.cursor(row_factory=lambda c: lambda t: set(t)) as cur1:
cur1.execute("select 1, 1, 2")
assert cur1.fetchall() == [{1, 2}]
cur = await conn.execute("select 'a' as ve")
assert await cur.fetchone() == ["Ave"]
- async with conn.cursor(row_factory=lambda c: set) as cur1:
+ async with conn.cursor(row_factory=lambda c: lambda t: set(t)) as cur1:
await cur1.execute("select 1, 1, 2")
assert await cur1.fetchall() == [{1, 2}]