A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-November/010790.html below:

[Python-Dev] Re: long formatting

[Python-Dev] Re: long formatting [Python-Dev] Re: long formattingGuido van Rossum guido@python.org
Wed, 29 Nov 2000 22:17:44 -0500
I just skimmed the pipermail python-dev archives and found one item
to pronounce on: what "%o" should do with negative longs.  I agree
with Tim.  Also for "%x".  Reason: this matches oct() and hex().

>>> oct(-10L)
'-012L'
>>> oct(-10)
'037777777766'
>>> hex(-10L)
'-0xAL'
>>> hex(-10)
'0xfffffff6'
>>> 

Compatibility be damned (in this case).

(One could argue that for plain ints, the same result are desirable;
however when these are used as bitmasks, I as human reader prefer to
see '0xfffffff6' rather than '-0xA'.  Ah the insanity of consistency!)

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4