[Python-Dev] PEP 460 reboot
Glenn Linderman
v+python at g.nevcal.com
Mon Jan 13 22:13:30 CET 2014
More information about the Python-Dev mailing list
Mon Jan 13 22:13:30 CET 2014
- Previous message: [Python-Dev] PEP 460 reboot
- Next message: [Python-Dev] PEP 460 reboot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1/13/2014 10:40 AM, Brett Cannon wrote:
> This even gives people in-place ASCII encoding for strings by always
> using '{:s}' with text which they can do when they port their code to
> run under both Python 2 and 3. So you should be able to do
> ``b'Content-Type: {:s}'.format('image/jpeg')`` and have it give ASCII.
> If you want more explicit encoding to latin-1 then you need to do it
> explicitly and not rely on the mini-language to do tricks for you.
> My preference is not have any, but if Guido is going say PBP here then
> I want absolute consistency across the board in how bytes.format()
> tweaks things.
> As for %s for the % operator calling ascii(), I think that will be a
> porting nightmare of finding out why your bytes suddenly stopped being
> formatted properly and then having to crawl through all of your code
> for that one use of %s which is getting bytes in. By raising a
> TypeError you will very easily detect where your screw-up occurred
> thanks to the traceback; do so otherwise feels too much like implicit
> type conversion and ask any JavaScript developer how that can be a bad
> thing.
>
So quote 3 is necessarily a violation of quote 1. But if quote 2 can
allow for one exception to its absolute consistency... that is probably
the best solution overall...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140113/52970a0c/attachment.html>
- Previous message: [Python-Dev] PEP 460 reboot
- Next message: [Python-Dev] PEP 460 reboot
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list