try `isinstance(userdata, (int, long, basestring))`