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. Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4