Message226749
| Author |
eric.smith |
| Recipients |
eric.smith, ncoghlan, vstinner |
| Date |
2014年09月11日.07:34:35 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1410420875.6.0.104328499043.issue22385@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I'm not particularly wild about the .precision syntax either, but I think the feature is generally useful.
Adding bytes.__format__ is exactly what "special output for bytes" _is_, as far as format() is concerned.
Another option would be to invent a new format specification for bytes. There's no reason it needs to follow the same syntax as for str, int, etc., except for ease of remembering the syntax, and some code reuse.
For example, although it's insane, you could do:
format(b'abcdwxyz', 'use_spaces,grouping=4,add_prefix')
-> '0x61626364 0x7778797a' |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年09月11日 07:34:35 | eric.smith | set | recipients:
+ eric.smith, ncoghlan, vstinner |
| 2014年09月11日 07:34:35 | eric.smith | set | messageid: <1410420875.6.0.104328499043.issue22385@psf.upfronthosting.co.za> |
| 2014年09月11日 07:34:35 | eric.smith | link | issue22385 messages |
| 2014年09月11日 07:34:35 | eric.smith | create |
|