Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Nick Coghlan
On 14 January 2014 16:04, Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 9:34 PM, Nick Coghlan wrote: > I've now looked at asciistr. (Thanks Glenn and Ethan for the link.) > > Now that I (hopefully) understand it, I'm worried that a text > processing algorithm that uses asciistr might under ha

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Terry Reedy
On 1/13/2014 10:16 PM, MRAB wrote: On 2014-01-14 03:03, Terry Reedy wrote: On 1/13/2014 7:48 PM, Chris Angelico wrote: And now for something completely different. My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
On 1/13/2014 9:25 PM, Nick Coghlan wrote: since this observation makes it clear that there's*no* coherent way to offer a pure binary interpolation API - the only general purpose combination mechanism for segments of binary data that can avoid making assumptions about the encodings of metacharact

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 9:34 PM, Nick Coghlan wrote: > On 14 January 2014 15:15, Stephen J. Turnbull wrote: >> The purity position is probably going to lose in the end, since Guido >> is clearly in the PBP camp at this point, and that's a strong >> indicator (especially since Nick has given up on

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Glenn Linderman
On 1/13/2014 8:58 PM, Stephen J. Turnbull wrote: Glenn Linderman writes: > On 1/13/2014 6:43 AM, Stephen J. Turnbull wrote: >> Glenn Linderman writes: >>> "smuggled binary" (great term borrowed from a different >>> subthread) muddies the waters of what you are dealing with. >> Not rea

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Ethan Furman
On 01/13/2014 09:12 PM, Ethan Furman wrote: On 01/13/2014 09:06 PM, Guido van Rossum wrote: In contrast, here's the tests I drew up for what I thought bytes should do for us (no code, just tests): https://bitbucket.org/stoneleaf/bytestring Ugh. Ignore for now, I need to update them to re

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Nick Coghlan
On 14 January 2014 15:15, Stephen J. Turnbull wrote: > The purity position is probably going to lose in the end, since Guido > is clearly in the PBP camp at this point, and that's a strong > indicator (especially since Nick has given up on convincing > python-dev). But that does not mean it's ent

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Ethan Furman
On 01/13/2014 09:06 PM, Guido van Rossum wrote: In contrast, here's the tests I drew up for what I thought bytes should do for us (no code, just tests): https://bitbucket.org/stoneleaf/bytestring -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@p

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Ethan Furman
On 01/13/2014 09:06 PM, Guido van Rossum wrote: Sorry to butt in, but can you post a link to the asciistr code? Google has too many hits for other things to be useful to find it, it seems. https://github.com/jeamland/asciicompat -- ~Ethan~ ___ Pytho

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Nick Coghlan
On 14 January 2014 15:03, Guido van Rossum wrote: > I don't think it's that easy. Just searching for '{' is enough to > break in surprising ways unless the format string is encoded in an > ASCII superset. I can think of two easy examples to illustrate this > (they're similar to the example I poste

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
On 1/13/2014 9:03 PM, Guido van Rossum wrote: Of course, nobody in their right mind would use a format string containing UTF-16 or EBCDIC. And that is precisely my point. When you're using a format string, all of the format string (not just the part between { and }) had better use ASCII or an ASC

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Glenn Linderman
On 1/13/2014 9:06 PM, Guido van Rossum wrote: Sorry to butt in, but can you post a link to the asciistr code? Google has too many hits for other things to be useful to find it, it seems. https://github.com/jeamland/asciicompat ___ Python-Dev mailing l

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Stephen J. Turnbull
Greg Ewing writes: > I don't think of my viewpoint as being PBP. That term > assumes there is purity there to be beaten. To my mind, > any notion of purity with respect to bytes objects > went out the window as soon as it was given a pile > of text methods -- together with a text-like literal

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Guido van Rossum
Sorry to butt in, but can you post a link to the asciistr code? Google has too many hits for other things to be useful to find it, it seems. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 6:25 PM, Terry Reedy wrote: > On 1/13/2014 4:32 PM, Guido van Rossum wrote: > >> I will doggedly keep posting to this thread rather than creating more >> threads. > > Please permit to to doggedly keep pointing you toward the possible solution > I posted on the tracker last

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Stephen J. Turnbull
Glenn Linderman writes: > On 1/13/2014 6:43 AM, Stephen J. Turnbull wrote: >> Glenn Linderman writes: >>> "smuggled binary" (great term borrowed from a different >>> subthread) muddies the waters of what you are dealing with. >> Not really. The "mud" is one or more of the serious deficiencie

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 2:16 PM, MRAB wrote: > Alternatively: > > g = max(self.saved_groups, [1]) > > or even: > > g = max(self.saved_groups or [1]) Patch created and tracker issue opened. I've used something similar to MRAB's idea as it looks compact. Thanks all! http://bugs.python.org/issue202

Re: [Python-Dev] magic method __bytes__

2014-01-13 Thread Benjamin Peterson
On Mon, Jan 13, 2014, at 05:38 PM, Ethan Furman wrote: > Has anyone actually used __bytes__ yet? What for? In the stdlib itself: email.message wsgiref pathlib ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/py

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 2:03 PM, Terry Reedy wrote: > On 1/13/2014 7:48 PM, Chris Angelico wrote: >> >> ValueError: max() arg is an empty sequence > > > try: > > g = max(self.saved_groups) + 1 > except ValueError: > g = 1 > > > Unless someone says that it is a bug for posix.getgroups to return

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 2:14 PM, Zachary Ware wrote: > On Mon, Jan 13, 2014 at 6:48 PM, Chris Angelico wrote: >> And secondly, how can I run the tests manually? I can't find a binary >> inside the buildarea tree. Does it get deleted afterward? > > Yes, that's the 'clean' step of the buildbot buil

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread MRAB
On 2014-01-14 03:03, Terry Reedy wrote: On 1/13/2014 7:48 PM, Chris Angelico wrote: And now for something completely different. My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Zachary Ware
On Mon, Jan 13, 2014 at 6:48 PM, Chris Angelico wrote: > And secondly, how can I run the tests manually? I can't find a binary > inside the buildarea tree. Does it get deleted afterward? Yes, that's the 'clean' step of the buildbot build process. I'd suggest making another clone elsewhere (you c

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Terry Reedy
On 1/13/2014 7:48 PM, Chris Angelico wrote: And now for something completely different. My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new "NAT Network" mode does. Why? I have no i

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread MRAB
On 2014-01-14 02:25, Terry Reedy wrote: On 1/13/2014 4:32 PM, Guido van Rossum wrote: > I will doggedly keep posting to this thread rather than creating more threads. Please permit to to doggedly keep pointing you toward the possible solution I posted on the tracker last October. But format

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Terry Reedy
On 1/13/2014 5:14 PM, Guido van Rossum wrote: On Mon, Jan 13, 2014 at 2:05 PM, Brett Cannon wrote: I have been going on the assumption that bytes.format() would change what '{}' meant for itself and would only interpolate bytes. That convenient between Python 2 and 3 since it represents what we

[Python-Dev] magic method __bytes__

2014-01-13 Thread Ethan Furman
Has anyone actually used __bytes__ yet? What for? -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.c

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Terry Reedy
On 1/13/2014 4:32 PM, Guido van Rossum wrote: > I will doggedly keep posting to this thread rather than creating more threads. Please permit to to doggedly keep pointing you toward the possible solution I posted on the tracker last October. But formatb() feels absurd to me. PEP 460 has nei

Re: [Python-Dev] Automatic encoding detection [was: Re: Python3 "complexity" - 2 use cases]

2014-01-13 Thread Steven D'Aprano
On Mon, Jan 13, 2014 at 07:58:43PM -0500, Terry Reedy wrote: > This discussion strikes me as more appropriate for python-ideas. That > said, I am leery of a heuristics module in the stdlib. When is a change > a 'bug fix'? and when is it an 'enhancement'? Depends on the nature of the heuristic.

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Emile van Sebille
On 1/13/2014 4:06 PM, Greg Ewing wrote: of text methods -- together with a text-like literal syntax and default repr(), even though at least half the time they're completely inappropriate! Better said as 'half the time they're coincidentally helpful!' My $.01 :) Emile __

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread MRAB
On 2014-01-13 21:51, Guido van Rossum wrote: Terminology. Let's use the official terminology rather than making stuff up. The docs at http://docs.python.org/3/library/string.html#formatspec use the following terminology: Replacement field: {...}; contains field name, conversion, format spec in

Re: [Python-Dev] Automatic encoding detection [was: Re: Python3 "complexity" - 2 use cases]

2014-01-13 Thread Terry Reedy
On 1/13/2014 7:06 PM, Chris Angelico wrote: On Tue, Jan 14, 2014 at 10:48 AM, Jim J. Jewett wrote: Agreed. But "most programs will need it, and people will either include (the same) 3rd-party library themselves, or write their own workaround, or have buggy code" *is* sufficient. Well, no, th

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Terry Reedy
On 1/13/2014 3:13 PM, Guido van Rossum wrote: On Mon, Jan 13, 2014 at 12:02 PM, Brett Cannon wrote: On Mon, Jan 13, 2014 at 2:51 PM, Terry Reedy wrote: I personally would not add 'bytes % whatever'. Personally, neither would I; just focus on bytes.format() and let % operator on strings slow

[Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
And now for something completely different. My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new "NAT Network" mode does. Why? I have no idea. But if anyone else is having the same pro

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Greg Ewing
Nick Coghlan wrote: Arbitrary binary data and ASCII compatible binary data are *different things* and the only argument in favour of modelling them with a single type is because Python 2 did it that way. I would say that ASCII compatible binary data is a *subset* of arbitrary binary data. As

Re: [Python-Dev] Automatic encoding detection [was: Re: Python3 "complexity" - 2 use cases]

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 10:48 AM, Jim J. Jewett wrote: >> The barrier for entry to the standard library is higher than mere >> usefulness. > > Agreed. But "most programs will need it, and people will either > include (the same) 3rd-party library themselves, or write their > own workaround, or hav

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Greg Ewing
Stephen J. Turnbull wrote: PBP doesn't think it's a great idea to pass around bytes that are implicitly some other type, but didn't mind it (or got used to it) in Python 2, and so they're not looking at that as a problem that Python 3 can solve. They're looking at Python 3 as the problem that pr

[Python-Dev] Automatic encoding detection [was: Re: Python3 "complexity" - 2 use cases]

2014-01-13 Thread Jim J. Jewett
>> So when it is time to guess [at the character encoding of a file], >> a source of good guesses is an important battery to include. > The barrier for entry to the standard library is higher than mere > usefulness. Agreed. But "most programs will need it, and people will either include (the s

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Greg Ewing
Nick Coghlan wrote: so the latter would be less of an attractive nuisance when writing code that needs to handle arbitrary binary formats and can't assume ASCII compatibility. Hang on a moment. What do you mean by code that "handles arbitrary binary formats"? As far as I can see, the propos

[Python-Dev] PEP 460 -- adding explicit assumptions

2014-01-13 Thread Jim J. Jewett
As best I can tell, some people (apparently including Guido and PEP author Antoine) are taking some assumptions almost for granted, while other people (including me, before Nick's messages) were not assuming them at all. Since these assumptions (or, possibly, rejections of them?) are likely to d

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
On 1/13/2014 1:59 PM, Guido van Rossum wrote: On Mon, Jan 13, 2014 at 1:29 PM, Glenn Linderman wrote: On 1/13/2014 12:09 PM, Guido van Rossum wrote: Yeah, the %s behavior with a string argument was a messy attempt at compromise. I was hoping to mimick a common use of %s in Python 2, where it c

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Nick Coghlan
On 14 Jan 2014 04:58, "Guido van Rossum" wrote: > > Let me try rebooting the reboot. > > My interpretation of Nick's argument is that he are asking for a bytes > formatting language that doesn't have an implicit ASCII assumption. > > To me this feels absurd. The formatting codes (%s, %c) themselve

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Donald Stufft
On Jan 13, 2014, at 5:31 PM, Donald Stufft wrote: > %s not accepting str is the major thing I’d personally be against. To be more clear b”%s” % “abc” == No b”%s” % 123 == Fine - Donald Stufft PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA signa

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Donald Stufft
On Jan 13, 2014, at 5:25 PM, Eric V. Smith wrote: > On 1/13/2014 4:59 PM, Guido van Rossum wrote: >> On Mon, Jan 13, 2014 at 1:29 PM, Glenn Linderman >> wrote: >>> If somehow (unlikely though it seems) we end up keeping %s (e.g. >>> strictly to ease porting), we could also keep %r as an alias

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Eric V. Smith
On 1/13/2014 4:59 PM, Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 1:29 PM, Glenn Linderman > wrote: >> If somehow (unlikely though it seems) we end up keeping %s (e.g. >> strictly to ease porting), we could also keep %r as an alias for %a. >> >> >> %s for strictly interpolating bytes eases

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 2:05 PM, Brett Cannon wrote: > I have been going on the assumption that bytes.format() would change what > '{}' meant for itself and would only interpolate bytes. That convenient > between Python 2 and 3 since it represents what we want it to (str and bytes > under the hood

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Antoine Pitrou
On Mon, 13 Jan 2014 13:56:44 -0800 Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 1:40 PM, Antoine Pitrou wrote: > > On Mon, 13 Jan 2014 13:32:28 -0800 > > Guido van Rossum wrote: > >> > >> But formatb() feels absurd to me. PEP 460 has neither a precise > >> specification or any actual exampl

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Brett Cannon
On Mon, Jan 13, 2014 at 4:36 PM, Ethan Furman wrote: > On 01/13/2014 01:20 PM, Mark Lawrence wrote: > >> On 13/01/2014 21:01, Paul Moore wrote: >> >>> >>> I think this should be for 3.5, and should not involve an accelerated >>> release of 3.5 - we should get it into the 3.5 code early and let >>

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Daniel Holth
On Mon, Jan 13, 2014 at 4:59 PM, Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 1:29 PM, Glenn Linderman > wrote: >> On 1/13/2014 12:09 PM, Guido van Rossum wrote: >> >> Yeah, the %s behavior with a string argument was a messy attempt at >> compromise. I was hoping to mimick a common use of %

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Brett Cannon
On Mon, Jan 13, 2014 at 4:51 PM, Guido van Rossum wrote: > Terminology. Let's use the official terminology rather than making stuff > up. > > The docs at http://docs.python.org/3/library/string.html#formatspec > use the following terminology: > > Replacement field: {...}; contains field name, con

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 1:29 PM, Glenn Linderman wrote: > On 1/13/2014 12:09 PM, Guido van Rossum wrote: > > Yeah, the %s behavior with a string argument was a messy attempt at > compromise. I was hoping to mimick a common use of %s in Python 2, > where it can be used with either an 8-bit string o

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 1:40 PM, Antoine Pitrou wrote: > On Mon, 13 Jan 2014 13:32:28 -0800 > Guido van Rossum wrote: >> >> But formatb() feels absurd to me. PEP 460 has neither a precise >> specification or any actual examples, so I can't tell whether the >> intention is that the format string c

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 01:20 PM, Mark Lawrence wrote: On 13/01/2014 21:01, Paul Moore wrote: I think this should be for 3.5, and should not involve an accelerated release of 3.5 - we should get it into the 3.5 code early and let people thrash out the details during the 3.5 release cycle. I disagree, i

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Nick Coghlan
On 14 Jan 2014 03:34, "Guido van Rossum" wrote: > > On Mon, Jan 13, 2014 at 8:51 AM, Nick Coghlan wrote: > > On 13 January 2014 23:57, Augie Fackler wrote: > >> 1) What do we need in terms of functionality > >> > >> Best guess, %s, %d, and %f. I've not done a full audit of the code, but some > >

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Greg Ewing
Nick Coghlan wrote: By allowing format characters that *do* assume ASCII, the entire construct is rendered unsafe - you have to look inside the format string to determine if it is assuming ASCII compatibility or not, thus the entire construct must be deemed as assuming ASCII compatibility at the

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
Terminology. Let's use the official terminology rather than making stuff up. The docs at http://docs.python.org/3/library/string.html#formatspec use the following terminology: Replacement field: {...}; contains field name, conversion, format spec in that order, all optional. Field name: either a

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 01:08 PM, Glenn Linderman wrote: +1 - what Ethan said. A real death, instead death by inappropriately transformed data, is fine by me, if b"%s" % str(...) doesn't have the appropriate .encode(...) call. But I could live with either. You mean instead of death by a thousand quote

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Antoine Pitrou
On Mon, 13 Jan 2014 13:32:28 -0800 Guido van Rossum wrote: > > But formatb() feels absurd to me. PEP 460 has neither a precise > specification or any actual examples, so I can't tell whether the > intention is that the format string can *only* contain {...} sequences > or whether it can also cont

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
On 1/13/2014 12:09 PM, Guido van Rossum wrote: Yeah, the %s behavior with a string argument was a messy attempt at compromise. I was hoping to mimick a common use of %s in Python 2, where it can be used with either an 8-bit string or a number as argument, acting like %b in the former case and lik

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
I will doggedly keep posting to this thread rather than creating more threads. In another thread, Nick has said he's okay with my proposal (not sure if that includes %s or not, but it now seems of lesser importance) as long as we simultaneously introduce formatb() and formatb_map() (the latter is

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Greg Ewing
Glenn Linderman wrote: Quotes in the stream are a great debug hint, without blowing up. But do you really want those quotes turning up in a *binary* stream, where they're somewhere between awkward and near-impossible to spot by eyeballing, and may only be discovered when something else -- likel

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Mark Lawrence
On 13/01/2014 21:01, Paul Moore wrote: I think this should be for 3.5, and should not involve an accelerated release of 3.5 - we should get it into the 3.5 code early and let people thrash out the details during the 3.5 release cycle. I disagree, it should be on pypi now so people can start tr

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
On 1/13/2014 9:38 AM, Ethan Furman wrote: On 01/13/2014 09:31 AM, Antoine Pitrou wrote: On Mon, 13 Jan 2014 08:36:05 -0800 Ethan Furman wrote: You mean crash all the time? I'd be fine with that for both the str case and the bytes case. But's probably too late to change the str case, and th

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
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 hav

Re: [Python-Dev] PEP 460 reboot and a bitter fight

2014-01-13 Thread Glenn Linderman
On 1/13/2014 5:06 AM, Nick Coghlan wrote: I figured out tonight that it's only positioning ASCII interpolation as an*alternative* to adding binary interpolation that I have a problem with. It isn't, because you lose the structural assurance that you haven't inadvertently introduced an assumption

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Paul Moore
On 13 January 2014 18:58, Guido van Rossum wrote: > I hear the objections against b'%s' % 'x' returning b"'x'" loud and > clear, and if the noise about that sub-issue is preventing folks from > seeing the absurdity in PEP 460, we can talk about a compromise, e.g. > use %b which would require its a

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Greg Ewing
Guido van Rossum wrote: On Sun, Jan 12, 2014 at 5:27 PM, Ethan Furman wrote: On 01/12/2014 04:47 PM, Guido van Rossum wrote: b'%s' % 'x' == b"'x'" (i.e. the three-byte string containing an 'x' enclosed in single quotes) I'm not sure about the quotes. Would anyone ever actually want those

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Serhiy Storchaka
13.01.14 15:57, Augie Fackler написав(ла): 1) What do we need in terms of functionality Best guess, %s, %d, and %f. I've not done a full audit of the code, but some limited looking over the grep hits for % in .py files suggests I'm right, and we could even do without %f (we only use that for 'hg

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
On 1/13/2014 1:49 AM, Mark Shannon wrote: So why not replace '%s' with '%a' for the ascii case and with '%b' for directly inserting bytes. Because %a and %b don't exist in Python 2.7? I thought this was about 3.5, not 2.7 ;) '%s' can't work in 3.5, as we must differentiate between strings whi

Re: [Python-Dev] cpython (3.3): Update Sphinx toolchain.

2014-01-13 Thread Georg Brandl
[If you want to continue this discussio, please move it from python-dev to sphinx-users. It is now completely offtopic for the former.] Anyway, just as a short explanation, you missed the point of the change: -M is not meant to be used directly but still via a (very short) Makefile. This isn't b

Re: [Python-Dev] PEP 460: allowing %d and %f and mojibake

2014-01-13 Thread Glenn Linderman
On 1/13/2014 6:43 AM, Stephen J. Turnbull wrote: Glenn Linderman writes: > On 1/12/2014 4:08 PM, Stephen J. Turnbull wrote: >> Glenn Linderman writes: >>> the proposals to embed binary in Unicode by abusing Latin-1 >>> encoding. >> Those aren't "proposals", they are currently feasible

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 12:02 PM, Brett Cannon wrote: Personally, neither would I; just focus on bytes.format() and let % operator on strings slowly go away. Hey, now, some of us like %! ;) -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https:

Re: [Python-Dev] cpython (3.3): Update Sphinx toolchain.

2014-01-13 Thread anatoly techtonik
That's cool, but historical heritage makes the make argument somewhat confusing for new users. The immediate question I can sense is "What is the difference between build and make?" To make (this word again) the critics constructive, let me pass some ideas about ideal user experience as I see it.

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Eric V. Smith
On 01/13/2014 03:09 PM, Guido van Rossum wrote: > If we have %b for strictly interpolating bytes, I'm fine with adding > %a for calling ascii() on the argument and then interpolating the > result after ASCII-encoding it. > > If somehow (unlikely though it seems) we end up keeping %s (e.g. > strict

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Daniel Holth
On Mon, Jan 13, 2014 at 3:11 PM, Yury Selivanov wrote: > On January 13, 2014 at 3:08:43 PM, Daniel Holth (dho...@gmail.com) wrote: >> >> I see it now. b"foo%sbar" % b'baz' should also expand to b"foob'foo'bar" >> >> Instead of "%b" could "%j" mean "I should have used + or join() >> here >> but was

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 12:02 PM, Brett Cannon wrote: > On Mon, Jan 13, 2014 at 2:51 PM, Terry Reedy wrote: >> I personally would not add 'bytes % whatever'. > > Personally, neither would I; just focus on bytes.format() and let % operator > on strings slowly go away. Well, % has some very strong

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Yury Selivanov
On January 13, 2014 at 3:08:43 PM, Daniel Holth (dho...@gmail.com) wrote: > > I see it now. b"foo%sbar" % b'baz' should also expand to b"foob'foo'bar" > > Instead of "%b" could "%j" mean "I should have used + or join() > here > but was too lazy" and work on str too? Isn’t this just error p

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 11:57 AM, Barry Warsaw wrote: > On Jan 13, 2014, at 02:13 PM, Donald Stufft wrote: >>On Jan 13, 2014, at 1:58 PM, Guido van Rossum wrote: >>> I hear the objections against b'%s' % 'x' returning b"'x'" loud and >>> clear, and if the noise about that sub-issue is preventi

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Daniel Holth
I see it now. b"foo%sbar" % b'baz' should also expand to b"foob'foo'bar" Instead of "%b" could "%j" mean "I should have used + or join() here but was too lazy" and work on str too? On Mon, Jan 13, 2014 at 2:51 PM, Terry Reedy wrote: > On 1/13/2014 1:40 PM, Brett Cannon wrote: > >> > So bytes for

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Brett Cannon
On Mon, Jan 13, 2014 at 2:51 PM, Terry Reedy wrote: > On 1/13/2014 1:40 PM, Brett Cannon wrote: > > > So bytes formatting really needn't (and shouldn't, IMO) mirror str >> > formatting. >> > > This was my presumption in writing byteformat(). > > > I think one of the things about Guido's proposa

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Barry Warsaw
On Jan 13, 2014, at 02:13 PM, Donald Stufft wrote: > >On Jan 13, 2014, at 1:58 PM, Guido van Rossum wrote: > >> I hear the objections against b'%s' % 'x' returning b"'x'" loud and >> clear, and if the noise about that sub-issue is preventing folks from >> seeing the absurdity in PEP 460, we can t

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Terry Reedy
On 1/13/2014 1:40 PM, Brett Cannon wrote: > So bytes formatting really needn't (and shouldn't, IMO) mirror str > formatting. This was my presumption in writing byteformat(). I think one of the things about Guido's proposal that bugs me is that it breaks the mental model of the .format() meth

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Antoine Pitrou
On Mon, 13 Jan 2014 18:51:32 + (UTC) Augie Fackler wrote: > > (Please don't remove me from the CC list - I could only respond via gmane > because I'm not subscribed to python-dev.) Responding via gmane is what I do, too :-) My NNTP client doesn't allow SMTP / NNTP mixed postings, so I'm forc

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Donald Stufft
On Jan 13, 2014, at 1:58 PM, Guido van Rossum wrote: > I hear the objections against b'%s' % 'x' returning b"'x'" loud and > clear, and if the noise about that sub-issue is preventing folks from > seeing the absurdity in PEP 460, we can talk about a compromise, e.g. > use %b which would require

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Augie Fackler
Antoine Pitrou pitrou.net> writes: > > On Mon, 13 Jan 2014 09:34:39 -0800 > Guido van Rossum python.org> wrote: > > On Mon, Jan 13, 2014 at 8:51 AM, Nick Coghlan gmail.com> wrote: > > > On 13 January 2014 23:57, Augie Fackler durin42.com> wrote: > > >> 1) What do we need in terms of functiona

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
Let me try rebooting the reboot. My interpretation of Nick's argument is that he are asking for a bytes formatting language that doesn't have an implicit ASCII assumption. To me this feels absurd. The formatting codes (%s, %c) themselves are expressed as ASCII characters. If you include anything

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 09:12 AM, Nick Coghlan wrote: On 14 January 2014 01:54, Ethan Furman wrote: Forgive me for being dense, but I don't understand your objection. With Guido's proposal, '%s' % bytes_data, bytes_data is passed through unchanged. Did you mean something else by "binary data"? I mean

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Donald Stufft
On Jan 13, 2014, at 1:45 PM, Daniel Holth wrote: > On Mon, Jan 13, 2014 at 12:42 PM, R. David Murray > wrote: >> On Mon, 13 Jan 2014 12:41:18 +0100, Antoine Pitrou >> wrote: >>> On Sun, 12 Jan 2014 18:11:47 -0800 >>> Guido van Rossum wrote: On Sun, Jan 12, 2014 at 5:27 PM, Ethan Furman

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Daniel Holth
On Mon, Jan 13, 2014 at 12:42 PM, R. David Murray wrote: > On Mon, 13 Jan 2014 12:41:18 +0100, Antoine Pitrou > wrote: >> On Sun, 12 Jan 2014 18:11:47 -0800 >> Guido van Rossum wrote: >> > On Sun, Jan 12, 2014 at 5:27 PM, Ethan Furman wrote: >> > > On 01/12/2014 04:47 PM, Guido van Rossum wrot

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Brett Cannon
On Mon, Jan 13, 2014 at 12:31 PM, Antoine Pitrou wrote: > On Mon, 13 Jan 2014 08:36:05 -0800 > Ethan Furman wrote: > > > On 01/13/2014 08:09 AM, Antoine Pitrou wrote: > > > On Mon, 13 Jan 2014 07:59:10 -0800 > > > Guido van Rossum wrote: > > >> On Mon, Jan 13, 2014 at 3:41 AM, Antoine Pitrou >

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Georg Brandl
Am 13.01.2014 18:38, schrieb Ethan Furman: > On 01/13/2014 09:31 AM, Antoine Pitrou wrote: >> On Mon, 13 Jan 2014 08:36:05 -0800 Ethan Furman wrote: >>> >>> You mean crash all the time? I'd be fine with that for both the str >>> case and the bytes case. But's probably too late to change the str

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 09:31 AM, Antoine Pitrou wrote: On Mon, 13 Jan 2014 08:36:05 -0800 Ethan Furman wrote: You mean crash all the time? I'd be fine with that for both the str case and the bytes case. But's probably too late to change the str case, and the bytes case should mirror what str does. L

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Augie Fackler
On Mon, Jan 13, 2014 at 12:39 PM, Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 9:37 AM, Augie Fackler wrote: > > > > On Mon, Jan 13, 2014 at 12:34 PM, Guido van Rossum > wrote: > >> > >> On Mon, Jan 13, 2014 at 8:51 AM, Nick Coghlan > wrote: > >> > On 13 January 2014 23:57, Augie Fackler

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Yury Selivanov
On January 13, 2014 at 12:45:40 PM, R. David Murray (rdmur...@bitdance.com) wrote: [snip] > There is no use case in the sense you are asking, just like there > is no > real use case for '%s' % b'x' producing "b'x'". But the real use > case > is exactly the same: to let you know your code is sc

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Augie Fackler
On Mon, Jan 13, 2014 at 12:34 PM, Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 8:51 AM, Nick Coghlan wrote: > > On 13 January 2014 23:57, Augie Fackler wrote: > >> 1) What do we need in terms of functionality > >> > >> Best guess, %s, %d, and %f. I've not done a full audit of the code, but

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread R. David Murray
On Mon, 13 Jan 2014 12:41:18 +0100, Antoine Pitrou wrote: > On Sun, 12 Jan 2014 18:11:47 -0800 > Guido van Rossum wrote: > > On Sun, Jan 12, 2014 at 5:27 PM, Ethan Furman wrote: > > > On 01/12/2014 04:47 PM, Guido van Rossum wrote: > > >> %s seems the trickiest: I think with a bytes argument it

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Antoine Pitrou
On Mon, 13 Jan 2014 09:34:39 -0800 Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 8:51 AM, Nick Coghlan wrote: > > On 13 January 2014 23:57, Augie Fackler wrote: > >> 1) What do we need in terms of functionality > >> > >> Best guess, %s, %d, and %f. I've not done a full audit of the code, but

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 8:51 AM, Nick Coghlan wrote: > On 13 January 2014 23:57, Augie Fackler wrote: >> 1) What do we need in terms of functionality >> >> Best guess, %s, %d, and %f. I've not done a full audit of the code, but some >> limited looking over the grep hits for % in .py files suggest

Re: [Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 9:37 AM, Augie Fackler wrote: > > On Mon, Jan 13, 2014 at 12:34 PM, Guido van Rossum wrote: >> >> On Mon, Jan 13, 2014 at 8:51 AM, Nick Coghlan wrote: >> > On 13 January 2014 23:57, Augie Fackler wrote: >> >> 1) What do we need in terms of functionality >> >> >> >> Best

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 08:39 AM, Ethan Furman wrote: On 01/13/2014 07:49 AM, Barry Warsaw wrote: On Jan 12, 2014, at 06:11 PM, Guido van Rossum wrote: Perhaps not, but it's a hint that you should probably think about an encoding. It's symmetric with how '%s' % b'x' returns "b'x'". Think of it as paybac

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 07:49 AM, Barry Warsaw wrote: On Jan 12, 2014, at 06:11 PM, Guido van Rossum wrote: Perhaps not, but it's a hint that you should probably think about an encoding. It's symmetric with how '%s' % b'x' returns "b'x'". Think of it as payback time. :-) Which unfortunately causes no e

  1   2   >