Re: What is ''r'' in python?

2009-01-06 Thread Gary Herron
Harish Vishwanath wrote: > Hello, > > I accidentally did this in the shell. > > >>> ''r'' > '' > >>> ''r'' == '' > True > >>> ''r'' == "" > True > > That is . However > if I try -> > > >>> ''c'' > File "", line 1 > ''c'' > ^ > SyntaxError: invalid syntax > >>> ''z'' > File "", line 1

Re: What is ''r'' in python?

2009-01-06 Thread Chris Rebert
On Tue, Jan 6, 2009 at 10:28 PM, Harish Vishwanath wrote: > Hello, > > I accidentally did this in the shell. > ''r'' > '' ''r'' == '' > True ''r'' == "" > True > > That is . However if I > try -> > ''c'' > File "", line 1 > ''c'' > ^ > SyntaxError: invalid syntax >>

Re: What is ''r'' in python?

2009-01-06 Thread Christopher Thunes
Hey Harish, Python automatically concatenates strings constants so this is actually '' then r'' which is the empty string followed by a 'raw' empty string. See here, http://docs.python.org/tutorial/introduction.html#strings. ''u'' and ''b'' will work for the same reason. - Chris Harish Vi

What is ''r'' in python?

2009-01-06 Thread Harish Vishwanath
Hello, I accidentally did this in the shell. >>> ''r'' '' >>> ''r'' == '' True >>> ''r'' == "" True That is . However if I try -> >>> ''c'' File "", line 1 ''c'' ^ SyntaxError: invalid syntax >>> ''z'' File "", line 1 ''z'' ^ SyntaxError: invalid syntax Any other charac