[docs] Bug?

Peter Demchenko pdemcenko at hotmail.com
Fri Feb 24 20:49:09 CET 2012



Hi,May be I miss something, but look...Why the script:----------------x="ab"  'cde'print(len(x))----------------
 - responds with 2?Whitespaces after "ab" can be or no - result is the same: 2It's rather dangerous situation, since the next line 'cde' produces no compilation errors, so you'll get string x stripped!!!  An excerpt from manual: "2.4.2. String literal concatenationMultiple adjacent string literals (delimited by whitespace), possibly using different quoting conventions, are allowed, and their meaning is the same as their concatenation. Thus, "hello" 'world' is equivalent to "helloworld". This feature can be used to reduce the number of backslashes needed, to split long strings conveniently across long lines, ..."
Ok. Now look at another excerpt from the same man:!!  "string.whitespace A string containing all characters that are considered whitespace. On most systems this includes the characters space, tab, linefeed, return, formfeed, and vertical tab"As you see there are no other chars between <x="ab">  and  <'cde'> - whitespaces only!    I have Phyton 2.7.2 and WindowsXP host
Best regards,
Peter 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20120224/ef8afc09/attachment.html>


More information about the docs mailing list