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


Groups > comp.lang.python > #24517

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

Date 2012-06-27 16:34 +0200
From Christian Tismer <tismer@stackless.com>
Subject Re: Why has python3 been created as a seperate language where there is still python2.7 ?
References (5 earlier) <jsbl4q$v84$1@dough.gmane.org> <4FEADFB4.5090301@stackless.com> <CAPTjJmpHaX1b+aHiRJ_a-kCUs-PrVZa6DGAw0AxKQ_=qpXJD5w@mail.gmail.com> <4FEB077E.1010607@stackless.com> <jsf2ol$h2e$1@dough.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.1552.1340807684.4697.python-list@python.org> (permalink)

Show all headers | View raw


On 27.06.12 15:44, Stefan Behnel wrote:
> Christian Tismer, 27.06.2012 15:15:
>> print, function or not, is not important enough to enforce a rewrite
>> everywhere because of syntax error. That hides the real semantic
>> changes which _are_ important.
>>
>> So what I would have done is to let it work in an imperfect way. People
>> then have the chance to rewrite with the print function, where it makes
>> sense. But old packages which need to be changed, only because they
>> have lots of
>>
>>      if DEBUG:
>>          print xxx, yyy, ...
>>
>> could just stay unchanged or migrated later after the real meat has
>> been properly tested etc.
> Well, at least a SyntaxError makes it easy to find. And even if you don't
> intend to use 2to3, you can still run it once to generate a patch for you
> that only fixes up "print". In many cases, that will also make it work in
> Py2 in such an "imperfect" way, either by doing the right thing already or
> by printing out a tuple instead of a space separated string. If it's only
> for debug output (which, as I said, would better be served by the logging
> module), I can't see why that would be all that unacceptable.
>
Ok, here comes the real story:
I extracted a few files from the old PIL package and made the stuff that was
needed for my own little utility with a couple of monkey-patches, import
hooks etc. After quite some trouble, this worked unter python 2.6 and 2.7,
with the unchanged original PIL files.
And I was after that: abuse PIL without maintaining it!

Then I got real problems when trying to make it run under python 3.2,
and from then on I needed two sets of source files, mostly because of
the print mess.
Most other things were adjustable by monkey-patches, moving to the io
module etc. etc.

In the end, the only thing that required a real change of source code
that I could not circumvent was the indexing of bytes, which is giving
chars under python 2.x, but integers under 3.x.

At this point my hope to keep the unmodified PIL files died, although
without print, this would have been an isolated single 20 lines block
in the TiffImagePlugin only, instead of much more changes criss-cross over
several sources.

Anyway, I ended up with a port of the relevant PIL files to python 3
with some backward-compatible additions (for heaven's sake, at least
python 3 accepts the __future__ imports), so now I'm down to single
source files, but unfortunately changed files, and I have to track
changes in the future.

That battle was lost: I wanted the PIL files simply to be drop-ins,
without going to work on PIL, because then I would do a complete
rewrite after some discussion with the author.

That's why I was unhappy with py3's missing flexibility.

ciao -- Chris

-- 
Christian Tismer             :^)   <mailto:tismer@stackless.com>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Karl-Liebknecht-Str. 121     :    *Starship* http://starship.python.net/
14482 Potsdam                :     PGP key -> http://pgp.uni-mainz.de
work +49 173 24 18 776  mobile +49 173 24 18 776  fax n.a.
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/

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


Thread

Re: Why has python3 been created as a seperate language where there is still python2.7 ? Michiel Overtoom <motoom@xs4all.nl> - 2012-06-25 12:10 +0200
  Re: Why has python3 been created as a seperate language where there is still python2.7 ? rantingrickjohnson@gmail.com - 2012-06-25 19:28 -0700
    Re: Why has python3 been created as a seperate language where there is still python2.7 ? Jeremiah Dodds <jeremiah.dodds@gmail.com> - 2012-06-26 01:04 -0400
    Re: Why has python3 been created as a seperate language where there is still python2.7 ? Stefan Behnel <stefan_ml@behnel.de> - 2012-06-26 08:24 +0200
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? rantingrickjohnson@gmail.com - 2012-06-27 20:32 -0700
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? rantingrickjohnson@gmail.com - 2012-06-27 20:32 -0700
  Re: Why has python3 been created as a seperate language where there is still python2.7 ? rantingrickjohnson@gmail.com - 2012-06-25 19:28 -0700
    Re: Why has python3 been created as a seperate language where there is still python2.7 ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-06-26 03:35 +0000
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Terry Reedy <tjreedy@udel.edu> - 2012-06-26 00:33 -0400
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-06-26 02:15 -0400
        Re: Why has python3 been created as a seperate language where there is still python2.7 ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-06-26 07:40 +0000
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Stefan Behnel <stefan_ml@behnel.de> - 2012-06-26 08:34 +0200
        Re: Why has python3 been created as a seperate language where there is still python2.7 ? rantingrickjohnson@gmail.com - 2012-06-27 20:53 -0700
          Re: Why has python3 been created as a seperate language where there is still python2.7 ? alex23 <wuwei23@gmail.com> - 2012-06-27 21:05 -0700
        Re: Why has python3 been created as a seperate language where there is still python2.7 ? rantingrickjohnson@gmail.com - 2012-06-27 20:53 -0700
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Christian Tismer <tismer@stackless.com> - 2012-06-27 12:25 +0200
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Chris Angelico <rosuav@gmail.com> - 2012-06-27 21:02 +1000
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Stefan Behnel <stefan_ml@behnel.de> - 2012-06-27 13:22 +0200
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-06-27 07:24 -0400
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Chris Angelico <rosuav@gmail.com> - 2012-06-27 22:05 +1000
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Christian Tismer <tismer@stackless.com> - 2012-06-27 15:15 +0200
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Stefan Behnel <stefan_ml@behnel.de> - 2012-06-27 15:44 +0200
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Chris Angelico <rosuav@gmail.com> - 2012-06-27 23:44 +1000
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Christian Tismer <tismer@stackless.com> - 2012-06-27 16:34 +0200
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Serhiy Storchaka <storchaka@gmail.com> - 2012-06-27 21:58 +0300
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Serhiy Storchaka <storchaka@gmail.com> - 2012-06-27 22:08 +0300
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Terry Reedy <tjreedy@udel.edu> - 2012-06-27 17:14 -0400
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Christian Tismer <tismer@stackless.com> - 2012-06-28 00:11 +0200
        Re: Why has python3 been created as a seperate language where there is still python2.7 ? alex23 <wuwei23@gmail.com> - 2012-06-27 17:44 -0700
          Re: Why has python3 been created as a seperate language where there is still python2.7 ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-06-28 04:32 +0000
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? rantingrickjohnson@gmail.com - 2012-06-27 20:25 -0700
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Serhiy Storchaka <storchaka@gmail.com> - 2012-06-28 08:36 +0300
      Re: Why has python3 been created as a seperate language where there is still python2.7 ? Stefan Behnel <stefan_ml@behnel.de> - 2012-06-28 07:47 +0200
        Re: Why has python3 been created as a seperate language where there is still python2.7 ? wxjmfauth@gmail.com - 2012-06-28 02:34 -0700
        Re: Why has python3 been created as a seperate language where there is still python2.7 ? wxjmfauth@gmail.com - 2012-06-28 02:34 -0700
          Re: Why has python3 been created as a seperate language where there is still python2.7 ? Chris Angelico <rosuav@gmail.com> - 2012-06-28 20:14 +1000
    Re: Why has python3 been created as a seperate language where there is still python2.7 ? Roy Smith <roy@panix.com> - 2012-06-27 07:45 -0400

csiph-web