>>> I'd be fine with adding '#' back to the formatting language for hex and oct. >> >> And bin, I assume? > > Of course.
somewhat on-topic, can i hear from some of you as far as use-cases for oct() and hex() [plus bin()] in Python code? i find "%x" or "%o" (and its variants) sufficient in serving my needs. in other words, why oct() and hex() built-in functions instead of elsewhere like in operator for those who desire a functional interface? another related inquiry, if we're going to have hex(), can its signature be expanded to include "%#X" functionality, i.e., hex(number, cap=False), as the default and someone who wants the "#" can do hex(123, cap=True)? on top of that, can hex() also support "%x" and '%X' functionality, i.e., hex(number, cap=False, leading=True), as the default, so i can do hex(123, leading=False) for '7b'? do you see how i'm trying to make life difficult and lead people down the path of not having hex(), oct(), or bin()? or are those three functions intended to obsolete "#"? :-) writing this message made me realize that i could have just done the following in my original post that started this whole thread: >>> i = 45 >>> 'dec: {0}/oct: {1}/hex: {2}'.format(i, oct(i), hex(i)) 'dec: 45/oct: 0o55/hex: 0x2d' it's definitely better than the "uglier" code in that post although this is less elegant than being able to specify the variable 'i' just once. cheers, -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Core Python Programming", Prentice Hall, (c)2007,2001 http://corepython.com wesley.j.chun :: wescpy-at-gmail.com python training and technical consulting cyberweb.consulting : silicon valley, ca http://cyberwebconsulting.com _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com