[Python-ideas] Different bases format specification
ncoghlan at gmail.com
Sat Dec 3 06:16:06 CET 2011
On Sat, Dec 3, 2011 at 3:06 PM, T.B. <bauertomer at gmail.com> wrote:
>>> Anyway, I think there should be 'B' and 'O' presentation types, that
>>> will be used for outputting '0B' and '0O' prefixes.
> Horrors such as an uppercase-only file/shell/whatever still exist. They are
> rare and you'll usually call upper() before sending a message/writing to a
> file to them, but it might worth adding 'B'.
You're setting your bar for "hey, let's change the way a builtin type
works" *way* too low.
It's *OK* if obscure corner cases like bases outside the main four (2,
8, 10, 16), or "upper case only" environments require extra code.
"Make easy things easy and hard things possible" is the goal, not
"build in complex features to handle special cases that only arise on
rare occasions and can already be dealt with using the vast array of
general purpose programming tools Python provides".
It's not that supporting arbitrary bases is a terrible idea - it's
that it doesn't come up often enough as a general programming problem
to be worth going to the effort of making the change. There's no such
thing as a "trivial" change to a Python builtin - they *all* have
significant repercussions, as the update ripples out through the
Python ecosystem over the course of several years (see
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas