Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.023 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'syntax': 0.04; 'subject:Python': 0.06; 'explicit': 0.07; 'prefix': 0.09; 'cc:addr :python-list': 0.11; '__future__': 0.16; 'above)': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'imports': 0.16; 'newer,': 0.16; 'wrote:': 0.18; 'import': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**0': 0.24; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'dec': 0.30; 'relative': 0.30; 'message-id:@mail.gmail.com': 0.30; 'subject:what': 0.31; 'fri,': 0.33; 'style': 0.33; 'subject:the': 0.34; 'classes': 0.35; 'received:google.com': 0.35; '2.6': 0.36; 'subject:?': 0.36; 'two': 0.37; 'saves': 0.38; 'pm,': 0.38; 'anything': 0.39; 'even': 0.60; 'skip:u 10': 0.60; 'new': 0.61; 'dont': 0.67; 'funny': 0.74; '(ie': 0.84; 'everything.': 0.84; 'to:none': 0.92; '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:cc :content-type; bh=Z9dvEp3YioeCVsPxWSdG9TU1ZBkaVQd1B3/mdNfcXn4=; b=DQY4XNxQ9CL3dEwMifN46WwnLRGl2Q4nYW0Y2Hrj0xnWb3q3j1gh63alOR2zjPOdr+ 0sEVeuHNhFg4NWgrHsQrgEy53zKs9IbMxVliJIOZMY4i15qw8oXFcFTxparZ7xRWqC/D IF3JWuJH2w8A3h30eIwBZa0+4l3kjdZl5lIcYZRzcOlU6J0wFUdR1gAw1A9KXuLj4PrF OWiN35Qi/1qOtDBhDfNR7Ib8FvyXoogx5YKsIVhaBxTj5InDmkWgBoQTjZ4zgiLwWt5q 7m7CqIMVUpWdXr/IjTCM9k1pVxXpIYj826OyxwSbG3ktUsSA3oS/V+JX0+d+fxHbx+Rt krcw== MIME-Version: 1.0 X-Received: by 10.68.247.6 with SMTP id ya6mr43102727pbc.45.1388124039845; Thu, 26 Dec 2013 22:00:39 -0800 (PST) In-Reply-To: References: <52BD0E12.3040108@gmail.com> Date: Fri, 27 Dec 2013 17:00:39 +1100 Subject: Re: So, what's the real story on Python 2 vs Python 3? 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.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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388124048 news.xs4all.nl 2829 [2001:888:2000:d::a6]:38867 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62781 On Fri, Dec 27, 2013 at 4:43 PM, Rustom Mody wrote: > 1. print: Use print with (). Dont use funny 2 syntax > 2. Always write strings with a u" prefix > 3. Always use new style classes > 4. Always use relative imports with explicit relative (ie use .) Even easier: 1. from __future__ import print_function 2. from __future__ import unicode_literals (3 and 4 as per your above) For anything 2.6 or newer, those two will give Py3 behaviour, at least in those two ways. Saves you having to put the explicit u prefix on everything. ChrisA