On Tue, Jan 6, 2009 at 10:28 PM, Harish Vishwanath <harish.shas...@gmail.com> wrote: > Hello, > > I accidentally did this in the shell. > >>>> ''r'' > '' >>>> ''r'' == '' > True >>>> ''r'' == "" > True > > That is <singlequote singlequote r singlequote singlequote>. However if I > try -> > >>>> ''c'' > File "<stdin>", line 1 > ''c'' > ^ > SyntaxError: invalid syntax >>>> ''z'' > File "<stdin>", line 1 > ''z'' > ^ > SyntaxError: invalid syntax > > Any other character that way is Invalid Syntax. What is so special about > character r enclose within a pair of single quotes?
That's probably an artifact of r being used as the prefix in the syntax for raw strings. See http://docs.python.org/reference/lexical_analysis.html#string-literals for more on raw strings. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list