Python Type Checking Function Definition In R