[issue24112] %b does not work, as a binary output formatter

2015-05-02 Thread Bob Stein

Bob Stein added the comment:

Ah, you're right, my mistake.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24112] %b does not work, as a binary output formatter

2015-05-02 Thread Steven D'Aprano

Steven D'Aprano added the comment:

This is not a bug, since %b is not supported in Python 2, only in Python 3:

https://docs.python.org/2/library/stdtypes.html#string-formatting-operations

No new features will be added to 2.7, so if you need %b you can use Python 3, 
or in Python 2.7 you can use the newer string format method instead:

py> "{:b}".format(42)
'101010'

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24112] %b does not work, as a binary output formatter

2015-05-02 Thread Bob Stein

New submission from Bob Stein:

`"%b"%42` produces a ValueError exception instead of outputting '101010'

Details here:  http://stackoverflow.com/a/29997703/673991

--
messages: 242388
nosy: BobStein
priority: normal
severity: normal
status: open
title: %b does not work, as a binary output formatter
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com