[issue14694] Option to show leading zeros for bin/hex/oct
Mark Dickinson
report at bugs.python.org
Sun Apr 29 18:15:22 CEST 2012
Mark Dickinson <dickinsm at gmail.com> added the comment:
-1. str.format already does this quite effectively; I don't see a real need to complicate the bin, hex and oct signatures.
>>> '{:016b}'.format(324)
'0000000101000100'
>>> '{:016o}'.format(324)
'0000000000000504'
>>> '{:016x}'.format(324)
'0000000000000144'
----------
nosy: +mark.dickinson
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14694>
_______________________________________
More information about the Python-bugs-list
mailing list