This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients cheryl.sabella, eric.smith, lisroach, pitrou, rhettinger, serhiy.storchaka, skrah, talin
Date 2017-06-12.17:43:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497289388.81.0.203639833707.issue30571@psf.upfronthosting.co.za>
In-reply-to
Content
The format code space is already crowded, and it isn't immediately obvious that '08B' will format the 2's complement representation of the number, as opposed to '08b' which prepends a sign bit.  Not to mention that, as Raymond remarked, we cannot use the same convention for hex formatting where 'X' already has a different meaning.

Instead, how about adding an optional argument to bin()?  And then we can also do the same for hex().

By the way, I do find annoying the default behaviour of prepending a sign bit on hexadecimal and binary displays (but I never use binary displays, so my annoyance is really with hexadecimal displays).
History
Date User Action Args
2017-06-12 17:43:08pitrousetrecipients: + pitrou, rhettinger, talin, eric.smith, skrah, serhiy.storchaka, lisroach, cheryl.sabella
2017-06-12 17:43:08pitrousetmessageid: <1497289388.81.0.203639833707.issue30571@psf.upfronthosting.co.za>
2017-06-12 17:43:08pitroulinkissue30571 messages
2017-06-12 17:43:08pitroucreate