<div dir="ltr">I asked this question here, <a href="http://stackoverflow.com/questions/16435233/this-python-string-literals-documentation-couldnt-explain-me-single-quote-pres">http://stackoverflow.com/questions/16435233/this-python-string-literals-documentation-couldnt-explain-me-single-quote-pres</a>,  . I was advised to ask here<br>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 8, 2013 at 4:56 PM, Alok Nayak <span dir="ltr"><<a href="mailto:aloknayak29@gmail.com" target="_blank">aloknayak29@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><table><tbody><tr><td>

            <br></td>
            
<td>
<div>
    <div>
        <p>This <a href="http://docs.python.org/2/reference/lexical_analysis.html#string-literals" rel="nofollow" target="_blank">python string literals documentation</a> couldn't explain: single quote presence inside double quoted string and viceversa.</p>




<p>I think both double quoted string and single quoted string need to be
 defined differently for representing the 'stringliteral' lexical 
definition.</p>

<blockquote>
<pre><code><span>shortstringchar </span><span>::=</span><span>  </span><span><</span><span>any source character </span><span>except</span><span> </span><span>"\" or newline or the quote></span></code></pre>



</blockquote>

<p>here in this definition 'the quote' isn't specific whether single (<code>'</code>) or double (<code>"</code>).</p><span class="HOEnZb"><font color="#888888">

    </font></span></div></div></td></tr></tbody></table><span class="HOEnZb"><font color="#888888"><br clear="all"><br>-- <br>Alok Nayak<br>Gwalior, India<br>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>Alok Nayak<br>Gwalior, India<br>
</div>