Cool, this can be done in any language with typing. For languages with dynamic typing, you would just check the type at runtime.
Also, for most dynamic languages, checking the type at runtime goes against the grain of the language. Python or Ruby code that is littered with type checks is often unnecessarily brittle.