[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread Neil Schemenauer
Changes by Neil Schemenauer : Added file: http://bugs.python.org/file33507/pep-draft.txt ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread Neil Schemenauer
Neil Schemenauer added the comment: Uploading new patch with the following changes: - Allow length 1 bytes object as argument to %c. - Make %r an alias for %a. I will upload a draft PEP (proposed as a replacement for 461). Victor, thanks for the review. My reply is: - regarding duplicated co

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread STINNER Victor
STINNER Victor added the comment: I reviewed your second patch on Rietveld. -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue20284] proof for concept patch for bytes formatting methods

2014-01-17 Thread Neil Schemenauer
Neil Schemenauer added the comment: I'm attaching v2 of my proposed patch. This one is quite a bit better, IMHO. - Introduce __ascii__ as a special method, like __str__ but required to exist only if an ASCII-only format exists. - Extract PyString_Format from Python 2.7 and update it for PyByt

[issue20284] proof for concept patch for bytes formatting methods

2014-01-16 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue20284] proof for concept patch for bytes formatting methods

2014-01-16 Thread Neil Schemenauer
New submission from Neil Schemenauer: This is a very rough, proof of concept patch that implements %-style formatting for bytes objects. Currently it calls __format__ with a bytes argument and expects a bytes result. I've only implemented support for bytes formatting for the 'long' object.