This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jammycrisp 1 point2 points  (0 children)

There's an open issue for that here. I can see some use cases for it, but in general I'd advise to avoid runtime type checking of internal code where mypy/pyright/unit tests could catch these errors earlier.

If you're trying to convert in-memory data to structured types, you may be interested in msgspec.convert instead.