[issue11039] Use of 'L' specifier is inconsistent when printing long integers

2011-01-28 Thread Konstantin Osipov

New submission from Konstantin Osipov kostja.osi...@gmail.com:

I'm using a 64 bit system, but the issue is as well repeatable on 32 bit 
systems: 

kostja@shmita:~$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) 
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
 0x
18446744073709551615L
 [0x]
[18446744073709551615L]
 str(0x)
'18446744073709551615'
 str([0x])
'[18446744073709551615L]'

Notice the 'L' specifier disappears when creating a string from an integer. 
I.e. depending on conversion order, 'L' specifier is present or absent in the 
resulting string representation.

I don't know the reason why 'L' specifier is necessary at all when printing 
integers, rather, I'd say it's very harmful, because makes Python program 
platform-dependent (since int is mapped to C long, 32-bit systems print 'L' 
where 64-bit systems don't), but please at least make the output consistent!

Thanks,
-- 
kostja

--
components: None
messages: 127284
nosy: kostja
priority: normal
severity: normal
status: open
title: Use of 'L' specifier is inconsistent when printing long integers
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11039
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11039] Use of 'L' specifier is inconsistent when printing long integers

2011-01-28 Thread Eric Smith

Eric Smith e...@trueblade.com added the comment:

There is no suffix in python 3.x. Since this is a feature request, and there 
will be no new releases of 2.x, I'm closing this.

--
nosy: +eric.smith
resolution:  - rejected
stage:  - committed/rejected
status: open - closed
type:  - feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11039
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11039] Use of 'L' specifier is inconsistent when printing long integers

2011-01-28 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Python objects can have two textual representations: see the difference between 
str() and repr():
http://docs.python.org/tutorial/inputoutput.html
And indeed, Python3 chose to drop the 'L' suffix.

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11039
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com