Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.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; 'wiki': 0.03; 'argument': 0.05; 'subject:Python': 0.06; 'ignored': 0.07; 'string': 0.09; '3.0,': 0.09; 'converted': 0.09; 'prefix': 0.09; 'cc:addr:python- list': 0.11; 'python': 0.11; '2.7': 0.14; '3.3,': 0.16; 'cc:name:python list': 0.16; 'expression.': 0.16; 'tuple': 0.16; "would've": 0.16; 'accordingly.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'print': 0.22; '2.x': 0.24; 'helper': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'andrew': 0.30; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'page.': 0.31; '3.2': 0.31; 'subject:what': 0.31; 'run': 0.32; 'fri,': 0.33; 'maybe': 0.34; 'subject:the': 0.34; 'display': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'functions.': 0.36; 'largely': 0.36; 'subject:?': 0.36; 'project': 0.37; 'starting': 0.37; 'being': 0.38; 'needed': 0.38; 'pm,': 0.38; 'enough': 0.39; 'most': 0.60; 'relatively': 0.65; 'to:addr:gmail.com': 0.65; 'dont': 0.67; '26,': 0.68; 'fact,': 0.69; 'funny': 0.74; '2013': 0.98 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:to :cc:content-type; bh=gc+yAu5acGQORLmO+nuQfQcakWyG0tyTKnPPVMpxt9g=; b=0svO+EggOl09h0zQ0sZrA0IACcV4AvDLjfkL2S/UoEJXO8nmgbx1RSCpILsXTXWGX/ 3KtLsPkX5gJ+xv+/8IxouvaaT/DT5LuCwPEt/YUcpV29ZQBZREbu5ozw+ZkXYh4eQ7gQ LjPGF3beWMZU0qwEIQBgqLNQa74qy6tuDCwEI5KKQzY6h/syRIx5aNRXopz+15rd5Vye 6QV1VIeHjHPFYugLCGFcVUrHck5DQ/qM5OFGHIHG3MC/EFa94iGL9O8PY66Syliw+9Cb clWfZCFHaPGiIivFio7n7n29x8u92urfp2nnyeEd+DX0GORH3YjoNcnidZ9s95FpgkCV +8LA== MIME-Version: 1.0 X-Received: by 10.194.248.233 with SMTP id yp9mr7509342wjc.52.1388125395526; Thu, 26 Dec 2013 22:23:15 -0800 (PST) In-Reply-To: References: <52BD0E12.3040108@gmail.com> Date: Thu, 26 Dec 2013 22:23:15 -0800 Subject: Re: So, what's the real story on Python 2 vs Python 3? From: Dan Stromberg To: Rustom Mody Content-Type: text/plain; charset=ISO-8859-1 Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388125403 news.xs4all.nl 2856 [2001:888:2000:d::a6]:46766 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62783 On Thu, Dec 26, 2013 at 9:43 PM, Rustom Mody wrote: > On Fri, Dec 27, 2013 at 10:50 AM, Andrew Berg wrote: > As for 2 maybe we need a wiki page. (Or do we have one already?) > Heres my largely ignoramus attempt at starting that: > > 1. print: Use print with (). Dont use funny 2 syntax. In fact, use parens with a single argument that may be a relatively complex string % or .format expression. Otherwise 2.x will think it's being passed a tuple and display accordingly. > 2. Always write strings with a u" prefix 3.0, 3.1 and 3.2 don't understand this, but 3.3 does. In a project I wanted to run on 2.5, 2.6, 2.7, 3.0, 3.1, 3.2 and 3.3, I dedicated a python module to most of my string constants, and converted as needed using a pair of helper functions. If Jython had been available with 2.7 compatibility at the time, I would've ignored 2.5 and 2.6; now Jython has a 2.7 beta which is good enough for at least some of my purposes.