How to convert a "long in a string" to a "long"?

Sion Arrowsmith siona at
Fri Nov 18 18:32:59 CET 2005

Steven Bethard  <steven.bethard at> wrote:
>ondekoza at wrote:
>> s = long("0xffffffffL")
>> ValueError: invalid literal for long(): 0xffffffffL
> >>> int("0xffffffff", 0)

So why does the base argument to int() (or long()) default to
10 and not 0?

\S -- siona at --
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump

More information about the Python-list mailing list