4 ms·
You really should check out pyright/pylance/basedpyright. Just an all around better type checker. Even has the "unknown" from typescript (kinda).
by davidatbu 1y ago
You really should check out pyright/pylance/basedpyright. Just an all around better type checker. Even has the "unknown" from typescript (kinda).
- quotemstr 1y agoIt still has a special case for dataclass-like things. I don't see how Python type checking (I haven't tried Red Knot) could let you do semi-magical things like Zod schema validation from TypeScript.
- davidatbu 1y ago100%. Python typing is nowhere near as powerful as TS, and the example you gave demonstrates that. I mentioned pyright because (some of) the specific concerns by OP are addressed by it.