title: Why is print("{}").format() valid syntax?
body: <p>Ran into some interesting Python behavior today. I though I was writing </p>
  
  <pre><code>print("{}".format("some value")) 
  </code></pre>
  
  <p>but instead I wrote</p>
  
  <pre><code>print("{}").format("some value")
  </code></pre>
  
  <p>and funnily enough it worked. So my question is, how does this work?</p>
  
  <h1>Digging deeper</h1>
  
  <p>This behavior seems to be python2 specific.</p>
  
  <h2>Python2.7</h2>
  
  <pre><code>&gt;&gt;&gt; print("{}").format("testing")
  testing
  </code></pre>
  
  <h2>Python3.4</h2>
  
  <pre><code>&gt;&gt;&gt; print("{}").format("testing)
    File "&lt;stdin&gt;", line 1
      print("{}").format("testing)
                                 ^
  SyntaxError: EOL while scanning string literal
  </code></pre>
  
  <p>It also seems like the print function of python2 doesn't have a return value but Python3 does? so that confuses me even more.</p>
  
  <h2>Python2.7</h2>
  
  <pre><code>&gt;&gt;&gt; type(print("testing))
    File "&lt;stdin&gt;", line 1
      type(print("testing))
               ^
  SyntaxError: invalid syntax
  &gt;&gt;&gt; a = print("testing")
    File "&lt;stdin&gt;", line 1
      a = print("testing")
              ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <h2>Python3.4</h2>
  
  <pre><code>&gt;&gt;&gt; type(print("{}"))
  {}
  &lt;class 'NoneType'&gt;
  &gt;&gt;&gt; a = print("{}")
  {}
  &gt;&gt;&gt; a
  &gt;&gt;&gt; type(a)
  &lt;class 'NoneType'&gt;
  </code></pre>