print longs

Emile van Sebille emile at fenx.com
Wed Oct 6 23:27:06 EDT 1999


Sorry about that... I cut and paste from IDLE, and that first line was
originally entered as :
>>> print 9876543219876541L
then I up-arrowed, edited, entered, etc...  ;-)


BTW, wouldn't it be convenient if Traceback also printed sys.version?

--

Emile van Sebille
emile at fenx.com
-------------------


Clement <clement at ans.com.au> wrote in message
news:37FBDE72.8BEA5E0 at ans.com.au...
> What OS are you using?  In my Redhat 6/Python 1.5.2, I have this,
>
> >>> print '%d' % 9876543219876541L
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> OverflowError: long int too long to convert
>
> >>> print '%d' % 987654321L
> 987654321
>
> Emile van Sebille wrote:
> >
> > Did I miss something?
> >
> > >>> print '%d' % 987654321987654321L
> > 987654321987654321L
> > >>> print '%d' % 987654321987654321L
> > Traceback (innermost last):
> >   File "<pyshell#5>", line 1, in ?
> >     print '%d' % 987654321987654321L
> > OverflowError: long int too long to convert
> > >>>
> >
> > --
> >
> > Emile van Sebille
> > emile at fenx.com
> > -------------------
> >
> > Clement <clement at ans.com.au> wrote in message
> > news:37F98517.DD12EF2F at ans.com.au...
> > > Try '%d'
> > >
> > > Greg Ewing wrote:
> > > >
> > > > Nathan Clegg wrote:
> > > > >
> > > > > Do I have to convert
> > > > > to a string and manually pull the 'L' off?
> > > >
> > > > Unfortunately, yes. Many other people think this
> > > > is a pain as well, but Guido doesn't seem to be
> > > > among them, so we're stuck with this for the time
> > > > being.
> > > >
> > > > Greg
> > >
> > > --
> > >
> > > Regards
> > >
> > > Clement
>
> --
>
> Regards
>
> Clement






More information about the Python-list mailing list