def my_func(my_arg): assert isinstance(my_arg, basestring) print my_arg