This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年05月02日 10:29 by BobStein, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg242388 - (view) | Author: Bob Stein (BobStein) | Date: 2015年05月02日 10:29 | |
`"%b"%42` produces a ValueError exception instead of outputting '101010' Details here: http://stackoverflow.com/a/29997703/673991 |
|||
| msg242389 - (view) | Author: Steven D'Aprano (steven.daprano) * (Python committer) | Date: 2015年05月02日 10:57 | |
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' |
|||
| msg242390 - (view) | Author: Bob Stein (BobStein) | Date: 2015年05月02日 11:04 | |
Ah, you're right, my mistake. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:16 | admin | set | github: 68300 |
| 2015年05月02日 11:04:13 | BobStein | set | messages: + msg242390 |
| 2015年05月02日 10:57:22 | steven.daprano | set | status: open -> closed nosy: + steven.daprano messages: + msg242389 resolution: not a bug stage: resolved |
| 2015年05月02日 10:29:18 | BobStein | create | |