Nick Coghlan added the comment: The core problem with the idea of adding bytes.format to Python 3 is that the real power of str.format actually lies in the extensible __format__ protocol and the associated format() builtin, as those rely heavily on text-specific assumptions.
I interpreted Amber's comments at the language summit as referring more to our changing tune regarding mod formatting from: - mod formatting is deprecated, use brace formatting instead; to - they're both fully supported, neither is deprecated; to - use brace formatting for text data, mod formatting for binary data Folks that followed our original "stop using mod formatting" guidance thus needed to change course when it became our recommended technique for formatting binary data. Since we now know format() and __format__ aren't suitable for binary data (PEP 361 originally included it, and it got dropped as we kept finding awkward corner cases), that means any new binary formatting proposal needs to explain: - how it compares to existing serialisation techniques (mod-formatting, the struct module, text-formatting+encoding, etc) - why it needs to be a builtin method or function rather than a new serialisation module ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3982> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com