Could we do the type checking in the python code?