title: Convert Python 2's long representation in Python 3
body: <p>In Python 2, I could do something like this,</p>
  
  <pre><code>test = "6L"
  print(long(test))
  &gt;&gt;&gt; 6
  </code></pre>
  
  <p>In <a href="https://www.python.org/dev/peps/pep-0237/" rel="nofollow noreferrer">PEP 237</a>, <code>int</code> and <code>long</code> were unified. </p>
  
  <p>Now, my problem is, if I had a database which contained Python 2 <code>long</code> representation as strings, how can I convert it back to <code>int</code> in Python 3.</p>
  
  <p>In Python 3,</p>
  
  <pre><code>test = "6L"
  print(int(test)) #since no long type
  &gt;&gt;&gt; ValueError: invalid literal for int() with base 10: '6L'
  </code></pre>
  
  <p>So, is their a built-in way to handle this problem ? I mean I know I could go and remove the trailing <code>'L</code>' in the string version of <code>6L</code>, but this seems like a nasty thing to do for this simple task.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Just to clarify on @BurhanKhalid comment. As in the example, those are stored as string literal. In Python 2, it was possible to cast them directly and this is the behavior I'm looking for in Python 3 (if possible).</p>