消息 [292871]
regarding the proposal for mini format languages for bytes (msg292663):
Wouldn't it be more consistent if the format specifiers are identical to the one of int's (see https://docs.python.org/3/library/string.html#format-specification-mini-language).
I.e. "X" / "x" for hex, "o" for octal, "d" for decimal, "b" for binary, "c" for character (=default). Only 'A' need to be added for printing only ascii characters.
Furthermore I cannot see in how far the format spec in http://bugs.python.org/issue22385#msg292663 ("h#,1") is more intuitive than in http://bugs.python.org/issue22385#msg226733 ("#,.4x"), which looks like the existing minilang.
Why does Python need a new format mini lang, if the existing one provides most of the requirements. As developer it is already hard to memorize the details of the existing minilang. Ideally I do not need to learn a similar but different one for bytes... |
|
| 日期 |
用户 |
动作 |
参数 |
| 2017-05-03 09:54:27 | mrh1997 | 修改 | recipients:
+ mrh1997, barry, gregory.p.smith, ncoghlan, belopolsky, vstinner, eric.smith, gotgenes, Arfrever, Christian H |
| 2017-05-03 09:54:27 | mrh1997 | 修改 | messageid: <1493805267.43.0.316011621192.issue22385@psf.upfronthosting.co.za> |
| 2017-05-03 09:54:27 | mrh1997 | 链接 | issue22385 messages |
| 2017-05-03 09:54:27 | mrh1997 | 创建 | |
|