Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Mark Shannon
On 13/01/14 03:47, Guido van Rossum wrote: On Sun, Jan 12, 2014 at 6:24 PM, Ethan Furman wrote: On 01/12/2014 06:16 PM, Ethan Furman wrote: If you do : --> b'%s' % 'some text' Ignore what I previously said. With no encoding the result would be: b"'some text'" So an encoding should def

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread M.-A. Lemburg
On 13.01.2014 07:51, Nick Coghlan wrote: > > [Using a new asciistr type] > > The key thing that the text model change in Python 3 enabled is for us > to use the type system to *help* with managing the complexity of > dealing with text encodings. We've got a long way with just the two > pure types,

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Nick Coghlan
On 13 Jan 2014 17:43, "Ethan Furman" wrote: > > On 01/12/2014 10:51 PM, Nick Coghlan wrote: >> >> >> I am a strong -1 on the more lenient proposal, as it makes binary >> interpolation in Python 3 an *unsafe operation* for ASCII incompatible >> binary formats. > > > No more unsafe that calling .upp

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Glenn Linderman
On 1/13/2014 12:46 AM, Mark Shannon wrote: On 13/01/14 03:47, Guido van Rossum wrote: On Sun, Jan 12, 2014 at 6:24 PM, Ethan Furman wrote: On 01/12/2014 06:16 PM, Ethan Furman wrote: If you do : --> b'%s' % 'some text' Ignore what I previously said. With no encoding the result would be

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Mark Shannon
On 13/01/14 09:19, Glenn Linderman wrote: On 1/13/2014 12:46 AM, Mark Shannon wrote: On 13/01/14 03:47, Guido van Rossum wrote: On Sun, Jan 12, 2014 at 6:24 PM, Ethan Furman wrote: On 01/12/2014 06:16 PM, Ethan Furman wrote: If you do : --> b'%s' % 'some text' Ignore what I previousl

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

2014-01-13 Thread Ethan Furman
On 01/12/2014 11:15 PM, Guido van Rossum wrote: (It's too late here to write more, but it looks like we are in for a bitter fight. :-( ) It's already been a bitter fight. The opponents of %-interpolation (Nick, Antoine, Turnbull, D'Aprano, et al*) all seem to be arguing basically what Nick s

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

2014-01-13 Thread Stephen J. Turnbull
Ethan Furman writes: > The part that you don't seem to acknowledge (sorry if I missed it) > is that there are str-like methods already on bytes. I haven't expressed myself well, but I don't much care about that. It's what Knuth would classify as a seminumerical method. What I do care about is

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Nick Coghlan
On 13 Jan 2014 17:14, "Donald Stufft" wrote: > > > On Jan 13, 2014, at 1:59 AM, Nick Coghlan wrote: > > > On 13 January 2014 16:52, Donald Stufft wrote: > >> > >> On Jan 13, 2014, at 12:45 AM, Glenn Linderman wrote: > >> > >> So then the question is whether to proceed with 3.4, delay this featu

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Antoine Pitrou
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 should just > >> insert those bytes (and the padding modifiers should

Re: [Python-Dev] Trying to focus the whole bytes/str formatting discussion

2014-01-13 Thread Nick Coghlan
On 13 January 2014 08:46, Brett Cannon wrote: > I don't know about the rest of you but I feel like the discussion is heading > off the rails (if it hasn't already jumped the tracks). Let's try to bring > this back around to something actionable which people can focus their energy > on as the amoun

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Nick Coghlan
On 13 January 2014 17:15, Guido van Rossum wrote: > On Sun, Jan 12, 2014 at 10:59 PM, Nick Coghlan wrote: >> All it takes is to let go of the idea "I wish the Python 3 bytes type >> was more like the Python 2 str type" and instead think "hmm, the >> Python 3 bytes type doesn't seem like a great f

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

2014-01-13 Thread Nick Coghlan
On 13 January 2014 17:59, Ethan Furman wrote: > On 01/12/2014 11:15 PM, Guido van Rossum wrote: >> >> >> (It's too late here to write more, but it looks like we are in for a >> bitter fight. :-( ) > > > It's already been a bitter fight. > > The opponents of %-interpolation (Nick, Antoine, Turnbull

Re: [Python-Dev] Python advanced debug support (update frame code)

2014-01-13 Thread Nick Coghlan
On 13 January 2014 09:08, Fabio Zadrozny wrote: > Hi Python-dev. > > I'm playing a bit on the concept on live-coding during a debug session and > one of the most annoying things is that although I can reload the code for a > function (using something close to xreload), it seems it's not possible t

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

2014-01-13 Thread Mark Lawrence
On 13/01/2014 07:59, Ethan Furman wrote: On 01/12/2014 11:15 PM, Guido van Rossum wrote: The proponents (myself, you, Stufft, Eric Smith, et al*) are arguing that bytes already has an ASCII bias, already has ASCII string methods, that it isn't the same as the Py2 world because if you combine

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

2014-01-13 Thread Stephen J. Turnbull
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 >> techniques in Python 3 for *some* use cases. The qu

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Barry Warsaw
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 end of headaches, often difficult to debug. h

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Barry Warsaw
On Jan 12, 2014, at 09:45 PM, Glenn Linderman wrote: >Quotes in the stream are a great debug hint, without blowing up. They actually terrible for debugging for exactly the same reason as coercion in Python 2. It's rarely what you really want, it silently succeeds, and it means that the user visi

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 01:49 AM, Mark Shannon wrote: '%s' can't work in 3.5, as we must differentiate between strings which meed to be encoded and bytes which don't. I don't understand this objection: def __mod__(self, other): if isinstance(other, bytes): # no encoding necessary elif

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Guido van Rossum
On Mon, Jan 13, 2014 at 3:41 AM, Antoine Pitrou wrote: > What is the use case for embedding a quoted ASCII-encoded representation > in a byte stream? It doesn't crash but produces undesired output (always, not only when the data is non-ASCII) that gives the developer a hint to think about encodin

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Antoine Pitrou
On Mon, 13 Jan 2014 07:59:10 -0800 Guido van Rossum wrote: > On Mon, Jan 13, 2014 at 3:41 AM, Antoine Pitrou wrote: > > What is the use case for embedding a quoted ASCII-encoded representation > > in a byte stream? > > It doesn't crash but produces undesired output (always, not only when > the d

[Python-Dev] PEP460 thoughts from a Mercurial dev

2014-01-13 Thread Augie Fackler
(sorry for not piling on any existing threads - I don't subscribe to python-dev due to lack of time) Brett Cannon asked me to chime in - I haven't actually read the very long thread at this point, I'm just providing responses to things Brett mentioned: 1) What do we need in terms of functionality

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

2014-01-13 Thread Ethan Furman
On 01/13/2014 02:48 AM, Stephen J. Turnbull wrote: Ethan Furman writes: The part that you don't seem to acknowledge (sorry if I missed it) is that there are str-like methods already on bytes. I haven't expressed myself well, but I don't much care about that. You don't care that there are st

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
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 wrote: What is the use case for embedding a quoted ASCII-encoded representation in a byte stream? It doesn't crash but produces undesired

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

2014-01-13 Thread Nick Coghlan
On 13 January 2014 23:57, Augie Fackler wrote: > (sorry for not piling on any existing threads - I don't subscribe to > python-dev due to lack of time) > > Brett Cannon asked me to chime in - I haven't actually read the very long > thread at this point, I'm just providing responses to things Brett

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 07:52 AM, Barry Warsaw wrote: On Jan 12, 2014, at 09:45 PM, Glenn Linderman wrote: Quotes in the stream are a great debug hint, without blowing up. They actually terrible for debugging for exactly the same reason as coercion in Python 2. It's rarely what you really want, it sil

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Ethan Furman
On 01/13/2014 01:13 AM, Nick Coghlan wrote: On 13 Jan 2014 17:43, "Ethan Furman" wrote: On 01/12/2014 10:51 PM, Nick Coghlan wrote: I am a strong -1 on the more lenient proposal, as it makes binary interpolation in Python 3 an *unsafe operation* for ASCII incompatible binary formats. No more

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Nick Coghlan
On 14 January 2014 01:54, Ethan Furman wrote: > On 01/13/2014 01:13 AM, Nick Coghlan wrote: > >> On 13 Jan 2014 17:43, "Ethan Furman" wrote: >>> >>> On 01/12/2014 10:51 PM, Nick Coghlan wrote: I am a strong -1 on the more lenient proposal, as it makes binary interpolation in Py

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Antoine Pitrou
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 > >> wrote: > >>> What is the use case for embedding a quoted ASCII-enco

Re: [Python-Dev] PEP 460 reboot

2014-01-13 Thread Antoine Pitrou
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 > >> wrote: > >>> What is the use case for embedding a quoted ASCII-enc

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

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] 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] 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 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] 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 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 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: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 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] 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 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 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 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 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 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] 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 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 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 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] 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 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 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 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 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 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 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 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] 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 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] 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] 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 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] 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 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] 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 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 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

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 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 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 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 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 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 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 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 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] 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 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] 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 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 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 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: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 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 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 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 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 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 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 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

[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 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] 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] 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

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

[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 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

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 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

  1   2   >