Python 2.3: int() ?

Terry Reedy tjreedy at udel.edu
Fri Jan 17 12:59:29 EST 2003


"Carsten Gaebler" <news at snakefarm.org> wrote in message
news:b09761$a32$1 at news.schlund.de...
> I just read the 2.3 'highlights' page on python org, and I'm a bit
> confused: it says '# int() - this can now return a long when
converting
> a string with many digits, rather than raising OverflowError.'
>
> What does 'can' mean here? Can I switch between returning a long or
> raising an exception?

No, 'can' means 'will' when appropriate.  This change is part of the
project of erasing the distinction between ints and longs as much as
possible.  The idea is that ints are an efficient representation of
'small' integers.

TJR






More information about the Python-list mailing list