[Python-Dev] long formatting

Finn Bock bckfnn@worldonline.dk
Wed, 29 Nov 2000 21:37:38 GMT


Hi,

While adding support to Jython for formatting of longs in "%[duxXo]", I
inadvertently introduced another difference between Python and Jython:

Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> print '%030o' % -10L
000000000000000000037777777766
>>>

Jython 2.0alpha1 on java1.3.0 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> print '%030o' % -10L
-00000000000000000000000000012
>>>

The CPython behaviour looks as if the number have been through a C long
before it is formatted. It that intended? Would jython be wrong if it
used the result above?

regards,
finn