Remix.run Logo
chrome111 3 months 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 3 months ago | parent | next [-]

The 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 3 months ago | parent | prev [-]

It is a different type.

You can verify that either via static typechecking, or at runtime.