2 ms·
Thanks for this example - it makes it clear it can be a mechanism for something like sqlc/typed sql (my go-to with python too, don't like orms) without a transp
by chrome111 1y ago
Thanks for this example - it makes it clear it can be a mechanism for something like sqlc/typed sql (my go-to with python too, don't like orms) without a transpilation step or arguably awkward language API wrappers to the SQL. We'll need linters to prevent accidentally using `f` instead of `t` but I guess we needed that already anyways. Great to be able to see the actual cost in the DB without having to actually find the query for something like `typeddb.SelectActiveAccount(I'd)`. Good stuff.
- WorldMaker 1y agoThe PEP says these return a new type `Template`, so you should be able to both type and/or duck type for these specifically and reject non-Template inputs.
- paulddraper 1y agoIt is a different type. You can verify that either via static typechecking, or at runtime.