Message180430
Well, msg171804 makes it a much bigger project than the feature that Twisted actually needs. Quoting:
* The default formatting should not use str(), but buffer protocol.
Fine.
* There is no place for floating point.
Actually they do need it -- and it's trivial to define, since fp only returns ASCII characters.
* There is no place for locale.
Agreed.
* There is no place for 'r' conversion (possible only for 'a').
Agreed.
* It should include the features of struct.pack(), int.to_bytes() and ctypes.
Not needed.
* Padding should be not only by space, but also by zeros (and possibly by other values).
Not needed.
* Alignment (padding to position divisible by some number).
Not needed.
* In addition to padding and truncating should be the ability to raise an exception in case of discrepancy between the needed and actual lengths.
Not needed.
* It unlikely needed attribute access and indexing.
I don't know, but these features certainly would be well-defined.
* Builtin format() should not work with this.
Fine.
Probably bytes.format() should not try to call v.__format__(); if an extension mechanism is needed it would be called something else, but given the limited set of types needed I think this can be skipped.
The most important requirement from Twisted is actually that it is called .format(), and that the overall format strings look like they did for 8-bit string formatting in Python 2. In particular b'a{}b{}c'.format(x, y), where x and y are bytes, should be equivalent to b'a' x + b'b' + y + b'c'. |
|
Date |
User |
Action |
Args |
2013-01-22 19:32:28 | gvanrossum | set | recipients:
+ gvanrossum, loewis, terry.reedy, exarkun, pitrou, vstinner, eric.smith, christian.heimes, benjamin.peterson, ezio.melotti, arjennienhuis, uau, martin.panter, serhiy.storchaka |
2013-01-22 19:32:28 | gvanrossum | set | messageid: <1358883148.18.0.689720826989.issue3982@psf.upfronthosting.co.za> |
2013-01-22 19:32:28 | gvanrossum | link | issue3982 messages |
2013-01-22 19:32:27 | gvanrossum | create | |
|