Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87535

Re: Python 2 to 3 conversion - embrace the pain

References (1 earlier) <20150316025301.GA94576@cskk.homeip.net> <mailman.409.1426476166.21433.python-list@python.org> <873855tts4.fsf@jester.gateway.sonic.net> <mailman.411.1426484388.21433.python-list@python.org> <55068cb0$0$12923$c3e8da3$5496439d@news.astraweb.com>
Date 2015-03-16 19:51 +1100
Subject Re: Python 2 to 3 conversion - embrace the pain
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.428.1426495912.21433.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Mar 16, 2015 at 6:56 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> [ a whole lot of stuff that I agree with, and then ... ]
> Module renames could be handled via stub modules. Even Unicode strings could
> hypothetically have been added via a __future__ import.

This part I don't agree with. The problem with the Unicode / bytes
distinction is that library functions are written to expect one or the
other. Even in the stdlib, issues have been found, and the future
import can't solve that. You can already create Unicode strings in
Py2, with the u"..." syntax; you can even make it the default with
unicode_literals; but you can't magically make functions in other
modules cope with the other type of string. (Not with a __future__
import, anyway. Maybe "from __fairy_godmother__ import pumpkin"?)
Whenever it's easy, I encourage people to write their Py2 code to be
Py3-compatible - put parens around their print calls, be clear about
integer vs float division, use the "as" syntax for exception catching
- but I don't encourage from __future__ import unicode_literals,
because it tends to just move problems around rather than solving
them.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-16 14:22 +1100
  Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-15 22:07 -0700
    Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-16 16:39 +1100
      Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-15 23:17 -0700
        Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-16 19:00 +1100
          Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-16 01:31 -0700
            Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 00:05 +1100
              Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-17 00:29 +1100
            Re: Python 2 to 3 conversion - embrace the pain Terry Reedy <tjreedy@udel.edu> - 2015-03-16 13:59 -0400
      Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-16 18:56 +1100
        Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-16 01:25 -0700
          Re: Python 2 to 3 conversion - embrace the pain INADA Naoki <songofacandy@gmail.com> - 2015-03-16 18:13 +0900
            Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-16 22:55 +1100
          Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 01:25 +1100
            Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-16 15:36 -0700
              Re: Python 2 to 3 conversion - embrace the pain Terry Reedy <tjreedy@udel.edu> - 2015-03-16 22:28 -0400
                Re: Python 2 to 3 conversion - embrace the pain wxjmfauth@gmail.com - 2015-03-17 01:31 -0700
              Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 22:26 +1100
                Re: Python 2 to 3 conversion - embrace the pain wxjmfauth@gmail.com - 2015-03-17 07:03 -0700
                Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-17 15:35 +0100
                Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-19 16:23 -0700
                Re: Python 2 to 3 conversion - embrace the pain Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-03-19 22:03 -0400
                Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-20 03:54 +0100
          Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 11:20 -0600
            Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 07:36 +1100
              Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 20:14 -0600
              Re: Python 2 to 3 conversion - embrace the pain Cameron Simpson <cs@zip.com.au> - 2015-03-17 17:47 +1100
          Re: Python 2 to 3 conversion - embrace the pain Terry Reedy <tjreedy@udel.edu> - 2015-03-16 13:47 -0400
          Re: Python 2 to 3 conversion - embrace the pain Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-16 18:14 +0000
          Re: Python 2 to 3 conversion - embrace the pain INADA Naoki <songofacandy@gmail.com> - 2015-03-17 04:41 +0900
          Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-17 09:02 +1100
            Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-17 04:04 +0100
              Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 21:33 -0600
                Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 19:36 +1100
              Re: Python 2 to 3 conversion - embrace the pain Ben Finney <ben+python@benfinney.id.au> - 2015-03-17 14:42 +1100
                Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-17 05:30 +0100
                Re: Python 2 to 3 conversion - embrace the pain Cameron Simpson <cs@zip.com.au> - 2015-03-18 08:53 +1100
              Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-17 14:49 +1100
                Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-17 05:26 +0100
                Re: Python 2 to 3 conversion - embrace the pain Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-17 04:36 +0000
                Re: Python 2 to 3 conversion - embrace the pain Grant Edwards <invalid@invalid.invalid> - 2015-03-17 14:50 +0000
                Re: Python 2 to 3 conversion - embrace the pain wxjmfauth@gmail.com - 2015-03-17 08:15 -0700
                Re: Python 2 to 3 conversion - embrace the pain Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-03-17 18:36 -0400
                Re: Python 2 to 3 conversion - embrace the pain Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-17 22:41 +0000
                Re: Python 2 to 3 conversion - embrace the pain Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-03-18 08:04 -0400
                Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-18 02:02 +0100
          [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 19:46 -0600
            Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-17 19:39 +1100
              Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-17 09:02 -0600
            Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-19 16:37 -0600
              Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain wxjmfauth@gmail.com - 2015-03-20 02:40 -0700
                Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-20 15:59 +0100
                Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-20 16:03 +0100
                Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-20 15:42 +0000
                Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-21 04:13 +1100
                Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain wxjmfauth@gmail.com - 2015-03-20 12:21 -0700
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-17 12:57 +1100
            Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-16 19:45 -0700
              Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 21:05 -0600
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 20:07 -0600
          Re: Python 2 to 3 conversion - embrace the pain Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-17 02:21 +0000
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Ben Finney <ben+python@benfinney.id.au> - 2015-03-17 13:40 +1100
            Package manager cooperation? (was Weaknesses of distro package managers) Rustom Mody <rustompmody@gmail.com> - 2015-03-16 20:09 -0700
              Re: Package manager cooperation? (was Weaknesses of distro package managers) Michael Torrie <torriem@gmail.com> - 2015-03-16 21:32 -0600
              Re: Package manager cooperation? (was Weaknesses of distro package managers) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-17 04:03 +0000
              Re: Package manager cooperation? (was Weaknesses of distro package managers) Chris Angelico <rosuav@gmail.com> - 2015-03-17 15:18 +1100
                Re: Package manager cooperation? (was Weaknesses of distro package managers) wxjmfauth@gmail.com - 2015-03-17 01:44 -0700
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 20:51 -0600
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-17 03:01 +0000
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Michael Torrie <torriem@gmail.com> - 2015-03-16 21:05 -0600
            Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Mario Figueiredo <marfig@gmail.com> - 2015-03-17 04:07 +0100
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-17 03:17 +0000
          Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain Alexander <xr.lists@gmail.com> - 2015-03-17 16:44 +1300
        Re: Python 2 to 3 conversion - embrace the pain Chris Angelico <rosuav@gmail.com> - 2015-03-16 19:51 +1100
    Re: Python 2 to 3 conversion - embrace the pain Terry Reedy <tjreedy@udel.edu> - 2015-03-16 04:53 -0400
      Re: Python 2 to 3 conversion - embrace the pain Paul Rubin <no.email@nospam.invalid> - 2015-03-16 02:27 -0700

csiph-web