[Python-Dev] Base-n integer formatting
mchermside at ingdirect.com
Wed Sep 10 10:30:08 EDT 2003
I think you have some interesting ideas, but this is really not the
best place to present them. The newsgroup comp.lang.python, also a
mailing list at python-list at python.org, is really the best place to
discuss these ideas. Python-dev is intended for discussion about
the development of Python. New ideas or language features are best
introduced first on c.l.py, then based on the feedback there, written
up as a PEP, *THEN* folks will start discussing it on python-dev as
they figure out HOW (and perhaps whether) to implement it. There's
an exception -- regular Python developers sometimes introduce ideas
on this list, but that's a very short list of people, and it's a
bit different, because if they bring it up it's because they're
already volunteering to implement it (and probably have a prototype
up and running already).
If you'll contact me _separately_, I'll be glad to give you my
thoughts on your suggestions.
-- Michael Chermside
From: Yuri Vilmanis [mailto:vilmanis at internode.on.net]
Sent: Wednesday, September 10, 2003 8:39 AM
To: python-dev at python.org
Subject: [Python-Dev] Base-n integer formatting
I have three feature requests for you: no. 1 is quite fundamental, no. 2 would
be a 'nice' useful feature and no. 3 is a bit more esoteric, but very useful
in certain applications
1) print formatting for integers is currently only available for octal, hex,
and decimal. This seems rather odd, as string to integer conversion is
available for bases 2 through 36. End result: when I want to do things in base 6 (rare, but it has happened twice) or much more commonly in binary, I
can read the numbers in, but cannot print the results - ie quite useless.
2) Input and output formatting for unary (which is commonly referred to as base 1, yes, I know it's not 'really' base 1 by the general deinition of base, but "base 1" is the convention) would also be good, as would roman numeral support, especially in word-processing applications or IO from any formatted document with roman page/section numbers
3) negative bases: I have needed this more times than I think some people would care to imagine. These representations have several very useful
properties such as implementation-independent signdness (hence arbirtrary word length), and some more interesting properties I won't expand on here.
Context: I find python very handy not only as a programming/scripting language
but also as a scratchpad for various number theory investigations.
Unfortunately the output formatting leaves all but the most basic
investigations out in the cold, and lack of negative base input/output makes
it harder to use python to look for certain patterns in result sets, not to mention getting the data in...
Python-Dev mailing list
Python-Dev at python.org
This email may contain confidential or privileged information. If you believe you have received the message in error, please notify the sender and delete the message without copying or disclosing it.
More information about the Python-Dev