test for raw string

Paul Rubin http
Wed Feb 25 15:37:46 EST 2004


John Hunter <jdhunter at ace.bsd.uchicago.edu> writes:
> 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
> 
> func(r'\hi mom')  # do_x
> func('hi mom')    # do_y

No.  Those are just two different ways of writing the same string.
It's like asking func(3.0) and func(3.00) to do two separate things.



More information about the Python-list mailing list