Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'syntax': 0.04; 'anyway.': 0.05; 'string.': 0.05; 'subject:Python': 0.06; 'float': 0.07; 'found,': 0.07; 'cc:addr:python-list': 0.11; '"from': 0.16; '6:56': 0.16; '__future__': 0.16; 'division,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'modules.': 0.16; 'tends': 0.16; 'exception': 0.16; 'wrote:': 0.18; '(not': 0.18; 'library': 0.18; 'module': 0.19; 'written': 0.21; 'import': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'bytes': 0.24; 'integer': 0.24; 'unicode': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; 'that.': 0.31; 'catching': 0.31; "d'aprano": 0.31; 'easy,': 0.31; 'steven': 0.31; 'with,': 0.31; 'handled': 0.32; 'stuff': 0.32; 'skip:_ 10': 0.34; 'maybe': 0.34; 'subject:the': 0.34; 'could': 0.34; 'problem': 0.35; "can't": 0.35; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'clear': 0.37; 'problems': 0.38; 'solving': 0.38; 'pm,': 0.38; 'rather': 0.38; 'expect': 0.39; 'even': 0.60; 'skip:u 10': 0.60; 'future': 0.60; 'solve': 0.60; 'mar': 0.68; 'default': 0.69; 'other.': 0.75; '2015': 0.84; 'calls,': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=LQDPXkERS8HTPARmxW4vOWLFx81549Q2pwYxTAUtnXI=; b=PgZQc6kEYjsQpbcI5BcBfuuPPeS6R6MYANX5Oap2J8vC3DrbMD72UJl83VL4jLTY1d yNNwNCDJD+TT03yB073fJsp64/f8UcHraPm0vQl8vfQ/bjkHT5j2G+tq56Fo0DB00/RJ lTa9GhsNt0Lbs2Xwc+ILJRdVY/rcp6GsRN6GYA7TipVRcjSPRLEHFe1+Dbth9kbY9Ffm uq6LeauMcfNB+VK4F0Ov3AdjnzfVWrxP1rfpJMrEX1W6jQ0zl8e3BuO/Fai2CJR6eIUC S9m1jf7MBb0QbflxovedyjYVLrdRwQ4OiVkI5eeOzedA4uJ+FV7hEC71SW61UlYaRB3U rIjg== MIME-Version: 1.0 X-Received: by 10.50.131.196 with SMTP id oo4mr107276261igb.2.1426495910233; Mon, 16 Mar 2015 01:51:50 -0700 (PDT) In-Reply-To: <55068cb0$0$12923$c3e8da3$5496439d@news.astraweb.com> References: <20150316025301.GA94576@cskk.homeip.net> <873855tts4.fsf@jester.gateway.sonic.net> <55068cb0$0$12923$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 16 Mar 2015 19:51:50 +1100 Subject: Re: Python 2 to 3 conversion - embrace the pain From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426495912 news.xs4all.nl 2861 [2001:888:2000:d::a6]:53792 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87535 On Mon, Mar 16, 2015 at 6:56 PM, Steven D'Aprano 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