Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-16 Thread Stephen J. Turnbull
Nick Coghlan writes: > - even if there is a test suite, sufficiently pervasive [str/bytes] > type ambiguity may make it difficult to use for fault isolation Difficult yes, but I would argue that that difficuly is inherent[1]. Ie, if it's pervasive, the fault should be isolated to the whole modu

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-15 Thread Nick Coghlan
On 10 June 2016 at 16:36, Neil Schemenauer wrote: > Nick Coghlan wrote: >> It could be very interesting to add an "ascii-warn" codec to Python >> 2.7, and then set that as the default encoding when the -3 flag is >> set. > > I don't think that can work. The library code in Python would spew > ou

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Neil Schemenauer
Nick Coghlan wrote: > It could be very interesting to add an "ascii-warn" codec to Python > 2.7, and then set that as the default encoding when the -3 flag is > set. I don't think that can work. The library code in Python would spew out warnings even in the cases when nothing is wrong with the a

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Nick Coghlan
On 10 June 2016 at 11:00, Neil Schemenauer wrote: > On 6/10/2016 10:49 AM, Nick Coghlan wrote: >> More -3 warnings in Python 2.7 are definitely welcome (since those can >> pick up runtime behaviors that the static analysers miss), and if >> there are things the existing code converters and static

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Neil Schemenauer
On 6/10/2016 10:49 AM, Nick Coghlan wrote: What Brett said is mostly accurate for me, except with one slight caveat: I've been explicitly trying to nudge you towards making the *existing tools better*, rather than introducing new tools. With modernize and futurize we have a fairly clear trade-off

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Nick Coghlan
On 10 June 2016 at 07:09, Cody Piersall wrote: >> One problem is that the str literals should be bytes >> literals. Comparison with None needs to be avoided. >> >> With Python 2 code runs successfully. With Python 3 the code >> crashes with a traceback. With my modified Python 3.6, the code >>

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Nick Coghlan
On 9 June 2016 at 16:43, Brett Cannon wrote: > That's not what I'm saying at all (nor what I think Nick is saying); more > tooling to ease the transition is always welcomed. What Brett said is mostly accurate for me, except with one slight caveat: I've been explicitly trying to nudge you towards

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Brett Cannon
On Thu, 9 Jun 2016 at 19:53 Mark Lawrence via Python-Dev < python-dev@python.org> wrote: > On 10/06/2016 00:43, Brett Cannon wrote: > > > > That's not what I'm saying at all (nor what I think Nick is saying); > > more tooling to ease the transition is always welcomed. The point we are > > trying t

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Paul Moore
On 10 June 2016 at 15:09, Cody Piersall wrote: >> One problem is that the str literals should be bytes >> literals. Comparison with None needs to be avoided. >> >> With Python 2 code runs successfully. With Python 3 the code >> crashes with a traceback. With my modified Python 3.6, the code >>

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Cody Piersall
> One problem is that the str literals should be bytes > literals. Comparison with None needs to be avoided. > > With Python 2 code runs successfully. With Python 3 the code > crashes with a traceback. With my modified Python 3.6, the code > runs successfully but generates the following warnings

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-10 Thread Paul Moore
On 10 June 2016 at 03:13, Barry Warsaw wrote: > In my own experience, and IIRC Amber had a similar experience, the ease of > porting to Python 3 really comes down to how bytes/unicode clean your code > base is. Almost all the other pieces are either pretty manageable or fairly > easily automated.

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Stephen J. Turnbull
Neil Schemenauer writes: > I have to wonder if you guys actually ported at lot of Python 2 > code. Python 3 (including stdlib) itself is quite a bit of code. > According to you guys, there is no problem No, according to us, there are problems, but in the code, not in the language or its impl

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Mark Lawrence via Python-Dev
On 10/06/2016 00:43, Brett Cannon wrote: That's not what I'm saying at all (nor what I think Nick is saying); more tooling to ease the transition is always welcomed. The point we are trying to make is 2to3 is not considered best practice anymore, and so targeting its specific output might not be

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Barry Warsaw
On Jun 09, 2016, at 05:35 PM, Neil Schemenauer wrote: >Amber Brown claimed that she spent $60k of her time porting Twisted to Python >3. I think there is lots of room to make our porting tools better. Amber gave a presentation at the language summit and a Pycon talk. The latter video is up on Y

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Neil Schemenauer
On 2016-06-09, Brett Cannon wrote: > I don't think you meant for what you said to sound insulting, > Neil, but it did feel like it upon first reading. Sorry, I think I misunderstood what you and Nick were saying. I've experienced a fair amount of negative feedback on my idea so I'm pretty cranky

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Brett Cannon
On Thu, 9 Jun 2016 at 16:08 Neil Schemenauer wrote: > On 2016-06-09, Brett Cannon wrote: > > On Thu, 9 Jun 2016 at 14:56 Nick Coghlan wrote: > > > Once you switch to those now recommended more conservative migration > > > tools, the tool suite you request already exists: > > > > > > - update you

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Neil Schemenauer
On 2016-06-09, Brett Cannon wrote: > On Thu, 9 Jun 2016 at 14:56 Nick Coghlan wrote: > > Once you switch to those now recommended more conservative migration > > tools, the tool suite you request already exists: > > > > - update your code with modernize or futurize > > - check it still runs on Pyt

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Fred Drake
On Thu, Jun 9, 2016 at 6:16 PM, Ethan Furman wrote: > That's awfully close to antipathy [1], my path module on PyPI. Good point. Increasing confusion would not help. > Besides, I liked the suggestion from the -ideas list: Python 2therescue. ;) Nice; I like that too. :-) -Fred -- Fred L.

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Ethan Furman
On 06/08/2016 02:40 PM, Fred Drake wrote: On Wed, Jun 8, 2016 at 5:33 PM, Ryan Gonzalez wrote: What about something like "unpythonic" or similar? Or perhaps... antipythy? That's awfully close to antipathy [1], my path module on PyPI. Besides, I liked the suggestion from the -ideas list: Py

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Brett Cannon
On Thu, 9 Jun 2016 at 14:56 Nick Coghlan wrote: > On 8 June 2016 at 14:01, Neil Schemenauer wrote: > > [I've posted something about this on python-ideas but since I now > > have some basic working code, I think it is more than an idea.] > > > > I think the uptake of Python 3 is starting to accel

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-09 Thread Nick Coghlan
On 8 June 2016 at 14:01, Neil Schemenauer wrote: > [I've posted something about this on python-ideas but since I now > have some basic working code, I think it is more than an idea.] > > I think the uptake of Python 3 is starting to accelerate. That's > good. However, there are still millions or

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-08 Thread Guido van Rossum
Or write your own set of 2to3 fixers that *are* necessary. On Wed, Jun 8, 2016 at 6:11 PM, Victor Stinner wrote: > 2016-06-08 23:01 GMT+02:00 Neil Schemenauer : > > - code coming out of 2to3 runs correctly on this modified Python > > Stop using 2to3. This tool adds many useless changes when you

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-08 Thread Victor Stinner
2016-06-08 23:01 GMT+02:00 Neil Schemenauer : > - code coming out of 2to3 runs correctly on this modified Python Stop using 2to3. This tool adds many useless changes when you only care of Python 2.7 and Python 3.4+. I suggest to use better tools like 2to6, modernize or my own tool: https://pypi.py

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-08 Thread Oleg Broytman
On Thu, Jun 09, 2016 at 10:08:50AM +1200, Greg Ewing wrote: > >On Jun 8, 2016 4:04 PM, "Neil Schemenauer" >> wrote: > > > > > > I've temporarily named it "Pragmatic Python". I'd like a better > > > name if someone can suggest one. Maybe something like Perverted, > > > De

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-08 Thread Greg Ewing
On Jun 8, 2016 4:04 PM, "Neil Schemenauer" > wrote: > > I've temporarily named it "Pragmatic Python". I'd like a better > name if someone can suggest one. Maybe something like Perverted, > Debauched or Impure Python. Python Two and Three Quarters. -- Greg _

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-08 Thread Fred Drake
On Wed, Jun 8, 2016 at 5:33 PM, Ryan Gonzalez wrote: > What about something like "unpythonic" or similar? Or perhaps... antipythy? -Fred -- Fred L. Drake, Jr. "A storm broke loose in my mind." --Albert Einstein ___ Python-Dev mailing list Pyt

Re: [Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-08 Thread Ryan Gonzalez
On Jun 8, 2016 4:04 PM, "Neil Schemenauer" wrote: > > [I've posted something about this on python-ideas but since I now > have some basic working code, I think it is more than an idea.] > > I think the uptake of Python 3 is starting to accelerate. That's > good. However, there are still millions

[Python-Dev] Smoothing the transition from Python 2 to 3

2016-06-08 Thread Neil Schemenauer
[I've posted something about this on python-ideas but since I now have some basic working code, I think it is more than an idea.] I think the uptake of Python 3 is starting to accelerate. That's good. However, there are still millions or maybe billions of lines of Python code that still needs to