Type hints for result objects from select #10760
-
Hello, What is the proper way to hint result object? I know that there is no way for SA to expose tuple content types right now. Like
and use typing.Sequence[ResultHint] as return type hint? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
we dont have any documented way to type the rows with the column names, just as tuples with the individual types like |
Beta Was this translation helpful? Give feedback.
we dont have any documented way to type the rows with the column names, just as tuples with the individual types like
Row[Tuple[int, str, list[int]]]
. in 2.1 we will finally fix the tuple part and you'll getRow[int, str, list[int]]
. but for the names, sure a protocol seems like the best idea.