Message208356
Another revision of the patch, now quite close to PEP 461 as proposed. Changes from PEP 461:
- include %a
- add -2 command-line flag. When enabled have %s fallback to calling PyObject_Str() and encoding to ASCII and also enable %r as alias for %a.
Changes from previous patch:
- remove __ascii__ special method, %s will only accept objects that
implement __bytes__ or the buffer API, unless -2 command line is used
- use buffer API if available
- add -2 command-line option
- Add prototypes for PyBytes_Format and _PyUnicode_FormatLong
- improve some exception messages
Reference counting in PyBytes_Format is quite hairy, could use some review. The code is nearly the same as Python 2.x stringobject.c. |
|
Date |
User |
Action |
Args |
2014-01-17 19:33:07 | nascheme | set | recipients:
+ nascheme, vstinner, eric.smith |
2014-01-17 19:33:06 | nascheme | set | messageid: <1389987186.49.0.722386532499.issue20284@psf.upfronthosting.co.za> |
2014-01-17 19:33:06 | nascheme | link | issue20284 messages |
2014-01-17 19:33:06 | nascheme | create | |
|