Creation of a standardised goto implementation of runtime typechecking #1224
matthewwardrop
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings!
I'd love to see the development of a first-class runtime type validation utility. There are many different implementations of this, all with pitfalls or differences, and having a standard runtime checker makes a lot of sense to me. If a single such validation utility gets enough use, it will also be kept up to date in ways that might not otherwise be true. Such a utility would be useful to unify the static type annotations with runtime validation, rather than having to write separate tooling for both; and libraries that want such validation could either depend on a small but widely supported library or import directly from the standard library (if that is where it was implemented).
I'm imagining the addition to
typing
or some other first-class module an additional public boolean function (perhaps with supporting private methods) that checks whether a given object satisfies a given type. For example:And so on.
This is easy enough to solve for my use-cases (by just becoming an n+1 project), but I was wondering if there was shared interest in unifying such tooling.
Beta Was this translation helpful? Give feedback.
All reactions