[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5 (original) (raw)
Brett Cannon brett at python.org
Mon Jan 6 15:12:16 CET 2014
- Previous message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Next message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Jan 6, 2014 at 8:59 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
On Tue, 7 Jan 2014 00:54:17 +1100 Chris Angelico <rosuav at gmail.com> wrote: > On Tue, Jan 7, 2014 at 12:44 AM, Antoine Pitrou <solipsis at pitrou.net> wrote: > > BTW, there's a subtlety here:
%s
currently means "insert the result > > of calling str", but bytes formatting should not call str. > > Since it derives from the C printf notation, it means "insert string > here". The fact that str will be called is secondary to that. I > would say it's not a problem for bytes formatting to call bytes, > or in some other way convert to bytes without calling str. > > Will it be confusing to have bytes and str supporting distinctly > different format operations? Might it be better to instead create a > separate and very different method on a bytes, just to emphasize the > difference?The people who want bytes formatting, AFAICT, want something that is reasonably 2.x-compatible. That means using the same method / operator and calling conventions.
Right, but that also doesn't mean that a library from the Cheeseshop couldn't be provided which works around any Python 2/3 differences. But my suspicion is anyone requesting this feature (e.g. Mercurial) want it implemented in C for performance and so some pure Python library to help with this won't get any traction. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140106/51d2d018/attachment.html>
- Previous message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Next message: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]