title: python string with three dots after newline ... what is this thing?
body: <p>I just saw this for the first time today.  What is this three dots thing called and what is it for?  My guess was to help improve readability.  Here is the example I saw:</p>
  
  <pre><code>g = """
  ... S -&gt; NP VP
  ... PP -&gt; P NP
  ... NP -&gt; Det N | Det N PP | 'I'
  ... VP -&gt; V NP | VP PP
  ... Det -&gt; 'an' | 'my'
  ... N -&gt; 'elephant' | 'pajamas'
  ... V -&gt; 'shot'
  ... P -&gt; 'in'
  ... """
  </code></pre>
  
  <p>this is what it outputs:</p>
  
  <pre><code>"\nS -&gt; NP VP\nPP -&gt; P NP\nNP -&gt; Det N | Det N PP | 'I'\nVP -&gt; V NP | VP PP\nDet -&gt; 'an' | 'my'\nN -&gt; 'elephant' | 'pajamas'\nV -&gt; 'shot'\nP -&gt; 'in'\n"
  </code></pre>
  
  <p><strong>Edit.</strong>
  The IPython interpreter appears to remove the "... " after a newline while the regular python interpreter does not.  This must be something specific to IPython then and not a language feature after all (maybe to simplify copy-pasting from the interpreter?)</p>
  
  <p><strong>Alternative '...' usage in python.</strong>
  I just saw the <code>...</code> in a different context the other day for multi-indexed  numpy arrays like this: <code>ar[0,...,1]</code>.  It does not affect the indexes in the middle.  </p>
  
  <p>Here is an example usage:</p>
  
  <pre><code>ar = np.zeros((10,20,30,40,50,60,70,80)) # 8-dimensional array
  ar2 = ar[:1,2:6,...,72:]
  ar2.shape() # prints (1, 4, 30, 40, 50, 60, 70, 8)
  </code></pre>