This python string literals documentationhttp://docs.python.org/2/reference/lexical_analysis.html#string-literalscouldn't explain: single quote presence inside double quoted string and viceversa.
I think both double quoted string and single quoted string need to be defined differently for representing the 'stringliteral' lexical definition.
shortstringchar ::= <any source character except "" or newline or the quote>
here in this definition 'the quote' isn't specific whether single (') or double (").
I asked this question here, http://stackoverflow.com/questions/16435233/this-python-string-literals-docu..., . I was advised to ask here