I have a function that takes a string as an argument. Is there a way to test whether the caller of this function passed in a raw string def func(s): if israw(s): do_x() else: do_y() func(r'\hi mom') # do_x func('hi mom') # do_y Thanks, John Hunter