Open kunom opened 2 weeks ago
Hello! This repository is intended as a CPython bug tracker, your problem is actually related to stubs which is not part of CPython; It's a part of typeshed. I can't transfer this issue to the typeshed repo, @AlexWaygood maybe you can? 🙂
This is indeed a typeshed problem. CPython documents that finalize()
returns:
finalize(): Return the final result of the aggregate as a type natively supported by SQLite.
Looks like this protocol should be generic.
Just to summarize my request:
step
can take multiple arguments of several typesfinalize
can return several types
Bug report
Bug description:
The create_aggregate documentation does not specify a result type of the aggregation and even allows for multiple aggregating values per row (
n_arg
parameter).However, the type declaration at
dbapi2.pyi
does not reflect that (comments added by me):I think that this is not correct. At least, I have working code that aggregates multiple strings into a combined one.
Also, it is in stark contrast to other, way more generic, type declarations at the same place (comments added by me):
CPython versions tested on:
3.12
Operating systems tested on:
Windows