You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I authored sqlalchemy/sqlalchemy#5777 which added a typevar to run_sync to infer the return value. At that time is was not possible to infer *args or **kwargs of the callable passed and nor was it possible to infer that the first argument of type Session passed automatically for you. Since Python 3.10 has been released we have additional typing constructs typing.ParamSpec and typing.Concatenate, both of which are available on older python versions using the typing_extensions backport.
Describe the solution you'd like
Properly type all of the run_sync methods, something along the lines of the following should do the trick (I haven't set up an environment to test):
just a heads up that all typing will be inline for SQLAlchemy 2.0 and my current development focus is getting typing ported. the typing / structure will also be very different from sqlalchemy2-stubs as far as fundamentals, although issues like function callers like run_sync() will apply in the same way obviously.
just a heads up that all typing will be inline for SQLAlchemy 2.0 and my current development focus is getting typing ported. the typing / structure will also be very different from sqlalchemy2-stubs as far as fundamentals, although issues like function callers like run_sync() will apply in the same way obviously.
Thanks for the info. I will leave the implementation for now. Is there a ticket to track the inline work?
Is your feature request related to a problem? Please describe.
I authored sqlalchemy/sqlalchemy#5777 which added a typevar to
run_sync
to infer the return value. At that time is was not possible to infer*args
or**kwargs
of the callable passed and nor was it possible to infer that the first argument of typeSession
passed automatically for you. Since Python 3.10 has been released we have additional typing constructstyping.ParamSpec
andtyping.Concatenate
, both of which are available on older python versions using thetyping_extensions
backport.Describe the solution you'd like
Properly type all of the
run_sync
methods, something along the lines of the following should do the trick (I haven't set up an environment to test):Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Have a nice day!
The text was updated successfully, but these errors were encountered: