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


Groups > comp.lang.python > #68641

Re: running python 2 vs 3

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'languages.': 0.04; '21,': 0.07; 'c++,': 0.07; 'python3': 0.07; 'suppose': 0.07; '#define': 0.09; 'instance.': 0.09; 'toss': 0.09; 'whichever': 0.09; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; '"from': 0.16; '4:59': 0.16; '__future__': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happily': 0.16; 'naming': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'possible,': 0.19; 'written': 0.21; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'certainly': 0.24; 'expanded': 0.24; 'unicode': 0.24; 'versions': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; "i've": 0.25; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'easier': 0.31; 'operations.': 0.31; 'perl': 0.31; 'restricted': 0.31; 'run': 0.32; 'fri,': 0.33; 'maybe': 0.34; 'could': 0.34; "can't": 0.35; 'common': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'vice': 0.36; 'problems': 0.38; 'handle': 0.38; 'pm,': 0.38; 'expect': 0.39; 'sure': 0.39; 'either': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'easy': 0.60; 'myself': 0.63; 'worth': 0.66; 'biggest': 0.67; 'mar': 0.68; 'judge': 0.68; 'apart': 0.72; 'audience': 0.74; 'lowest': 0.74; '*really*': 0.84; 'batchelder': 0.84; 'comment.': 0.84; 'cost,': 0.84; 'differences,': 0.84; 'pike': 0.84; 'regarded': 0.84; 'ships': 0.84; 'worthwhile.': 0.84; 'care,': 0.91; 'to:none': 0.92; 'choice.': 0.93
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=zoIoAL5bx5bVwlu3AJqzRQ5PNRADAKSe1TmJNgjWJZg=; b=cyRBLiUVelMTPSFYcGGMYFVpi6Hp0ndOfYbDz6uwdSsFIeo20F8nqhD0w6No/hkhXg 3mSpWUMVzEGf23dD2K/UgnjJ0C/QXHyN7IsOcRnHtUfD3rRi/XggYueBEnsoS5HTKv7C QBu3pRkESBU6MW3qEQq9i3hbWLUFU6Vu0OKawCSWg3sU0R3G164czX0sPqX/PBGmxTwX ja8a9os9FuzifOmqiJ9nfCphJlN16W0Taje7l/S0oFitF8bQaIHMKS3SvNpOHc5jSAft eXtXawVtR6P4mwNFi313JXVzPaPuyzwc2kUtXJlu6oTIHuGyda0qxTnKk0jo8LAp/8D/ CRdA==
MIME-Version 1.0
X-Received by 10.68.235.6 with SMTP id ui6mr48532195pbc.45.1395357505262; Thu, 20 Mar 2014 16:18:25 -0700 (PDT)
In-Reply-To <8738icmrw4.fsf@elektro.pacujo.net>
References <bp0e1eF613oU1@mid.individual.net> <87ob10nbeh.fsf@elektro.pacujo.net> <532B4750.2090006@yahoo.com> <87eh1wpr96.fsf@elektro.pacujo.net> <mailman.8316.1395347407.18130.python-list@python.org> <8738icppoe.fsf@elektro.pacujo.net> <mailman.8320.1395348816.18130.python-list@python.org> <87pplgoac6.fsf@elektro.pacujo.net> <mailman.8322.1395351136.18130.python-list@python.org> <8738icmrw4.fsf@elektro.pacujo.net>
Date Fri, 21 Mar 2014 10:18:25 +1100
Subject Re: running python 2 vs 3
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8330.1395357989.18130.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1395357989 news.xs4all.nl 2851 [2001:888:2000:d::a6]:35270
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:68641

Show key headers only | View raw


On Fri, Mar 21, 2014 at 9:23 AM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Ned Batchelder <ned@nedbatchelder.com>:
>> On 3/20/14 4:59 PM, Marko Rauhamaa wrote:
>>> Well, with proper care, I suppose the same code base could support perl
>>> as well. ;)
>>
>> I'm not sure how to take this comment. I feel like you are mocking my
>> choice. I wanted to make coverage.py available to as broad an audience
>> as possible, something that I think is worthwhile. Yes, there was an
>> engineering cost, but the tradeoff was worth it.
>
> I can't judge if your particular choice was the right one. My only point
> is that python2 and python3 are so far apart as to be regarded as
> independent languages.

They're definitely not independent languages. The biggest change is
str/unicode->bytes/str, and you can get part of that in Python 2.6/2.7
with "from __future__ import unicode_literals". You may still run into
problems with some functions that expect str and won't take unicode
(or vice versa), but it's easy to make code that runs across both
versions that way. Then toss in "from __future__ import
print_function" and happily use the expanded features of print, or go
for the lowest common denominator:

print("some single string")

which works happily in all versions of Python.

I've written code that runs on 2.6+/3.2+. (Or maybe it's 3.1+;
whichever version Debian Squeeze ships with.) It's pretty easy. It's
certainly a lot easier than writing code that runs as either Pike or
C++, for instance. THOSE are independent languages. (And yes, I've
written that sort of code. Had a #define block up the top to handle
some naming differences, and then restricted myself to a *really*
narrow set of common operations. Was a neat way to prove correctness,
though.)

ChrisA

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


Thread

running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 14:58 +0000
  Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 17:21 +0200
    Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 16:00 +0000
      Re: running python 2 vs 3 Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-03-20 11:14 -0500
        Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 17:10 +0000
          Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 04:30 +1100
          Re: running python 2 vs 3 Gary Herron <gary.herron@islandtraining.com> - 2014-03-20 10:45 -0700
          Re: running python 2 vs 3 John Gordon <gordon@panix.com> - 2014-03-20 19:07 +0000
            Re: running python 2 vs 3 Terry Reedy <tjreedy@udel.edu> - 2014-03-20 18:05 -0400
              Re: running python 2 vs 3 alex23 <wuwei23@gmail.com> - 2014-03-21 12:37 +1000
          Re: running python 2 vs 3 Michael Torrie <torriem@gmail.com> - 2014-03-20 15:44 -0600
    Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 18:56 +0000
    Re: running python 2 vs 3 Eric Jacoboni <eric.jacoboni@gmail.com> - 2014-03-20 20:07 +0100
      Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 16:26 -0400
        Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 21:16 +0000
        Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:32 +0000
          Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 21:06 -0400
            Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 03:16 +0000
              Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 14:34 +1100
          Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 12:10 +1100
          Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 21:20 -0400
    Re: running python 2 vs 3 Alan Meyer <ameyer2@yahoo.com> - 2014-03-20 15:53 -0400
      Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:08 +0200
        Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 20:22 +0000
          Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:30 +0200
            Re: running python 2 vs 3 Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-03-20 15:43 -0500
            Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 20:44 +0000
              Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:50 +0200
                Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 21:36 +0000
                Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:59 +0000
                Re: running python 2 vs 3 Roy Smith <roy@panix.com> - 2014-03-20 21:06 -0400
                Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 13:18 +1100
                Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-21 09:40 +0000
                Re: running python 2 vs 3 alister <alister.nospam.ware@ntlworld.com> - 2014-03-21 12:09 +0000
                Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 12:15 +1100
            Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-20 22:39 +0000
        Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 16:27 -0400
          Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:42 +0200
            Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 16:53 -0400
              Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:59 +0200
                Re: running python 2 vs 3 Chris Kaynor <ckaynor@zindagigames.com> - 2014-03-20 14:18 -0700
                Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 17:31 -0400
                Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 00:23 +0200
                Re: running python 2 vs 3 Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-03-20 22:42 +0000
                Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 10:18 +1100
                Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 07:49 +0200
                Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 16:54 +1100
                Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 08:08 +0200
                Re: running python 2 vs 3 Rustom Mody <rustompmody@gmail.com> - 2014-03-20 23:51 -0700
              Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:37 +0000
                Re: running python 2 vs 3 Ethan Furman <ethan@stoneleaf.us> - 2014-03-20 18:23 -0700
              Re: running python 2 vs 3 Rustom Mody <rustompmody@gmail.com> - 2014-03-20 19:20 -0700
        Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 10:04 +1100
      Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 15:10 -0500
        Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 21:28 +0000
          Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 16:46 -0500
          Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-21 00:17 +0200
          Re: running python 2 vs 3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-21 00:29 +0000
    Re: running python 2 vs 3 Dan Stromberg <drsalists@gmail.com> - 2014-03-20 13:38 -0700
      Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 22:46 +0200
  Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 11:11 -0500
    Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 17:23 +0000
      Re: running python 2 vs 3 Chris Angelico <rosuav@gmail.com> - 2014-03-21 04:29 +1100
        Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 19:45 +0200
      Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 12:42 -0500
        Re: running python 2 vs 3 Marko Rauhamaa <marko@pacujo.net> - 2014-03-20 19:47 +0200
          Re: running python 2 vs 3 Ned Batchelder <ned@nedbatchelder.com> - 2014-03-20 14:45 -0400
          Re: running python 2 vs 3 Mark H Harris <harrismh777@gmail.com> - 2014-03-20 14:36 -0500
      Re: running python 2 vs 3 Terry Reedy <tjreedy@udel.edu> - 2014-03-20 17:52 -0400
        Re: running python 2 vs 3 notbob <notbob@nothome.com> - 2014-03-20 22:19 +0000

csiph-web