[Python-Dev] re: %b format (no, really)

Greg Wilson Greg.Wilson@baltimore.com
Thu, 7 Jun 2001 12:03:44 -0400

Prompted in part by the comment in Michael Hudson's
python-dev summary about this discussion having died,
I'd like to summarize:

1. Most people who commented felt that a base-2 format
   would be useful, if only for teaching and debugging.
   With regard to questions about byte order:

   A. Integer values are printed as base-2 numbers, so
      byte order is irrelevant.

   B. Floating-point numbers are printed as:

      [sign] [mantissa] [exponent]

      The mantissa and exponent are shown according
      to rule A.

2. Inventing a format for converting to arbitrary
   bases is dubious hypergeneralization (to borrow a

3. Implementation should mirror octal and hexadecimal
   support, e.g. a 'bin()' function to go with 'oct()'
   and 'hex()'.

4. The desirability or otherwise of a "%b" format
   specifier has nothing to do with the relative
   merits of any early microprocessor :-).

If no-one has strong objections, I'll put together a
PEP on this basis.


The information contained in this message is confidential and is intended 
for the addressee(s) only.  If you have received this message in error or 
there are any problems please notify the originator immediately.  The 
unauthorized use, disclosure, copying or alteration of this message is 
strictly forbidden. Baltimore Technologies plc will not be liable for direct, 
special, indirect or consequential damages arising from alteration of the 
contents of this message by a third party or as a result of any virus being 
passed on.

In addition, certain Marketing collateral may be added from time to time to 
promote Baltimore Technologies products, services, Global e-Security or 
appearance at trade shows and conferences.
This footnote confirms that this email message has been swept by 
Baltimore MIMEsweeper for Content Security threats, including
computer viruses.