
Python, the Web and Little Things on my Mind - mattyb
http://lucumr.pocoo.org/2011/1/22/python-the-web-and-little-things/
======
jedsmith
Well, that seals the deal. Bummer.

I really hoped Armin would come around, and I committed to Werkzeug for a new
project with eyes on 3. This was a direct result of the PEP 3333 acceptance,
and I apparently backed the wrong horse.

The worst part of this whole thing is that it is getting harder to explain
working in Python to my other-language friends. Well there's 3, and yeah it's
at 3.2, but don't use it. Nobody uses 3. Maybe distribute. Maybe setuptools.
I'm not sure.

As a non-participating, quiet consumer of Python, I am very confused about the
future of my chosen language. I think it is intermediate, perhaps career-
minded (internal) users of Python like myself that are confused the most.

Edit: On reflection, I was encouraged to see what I perceived to be
frustration on the part of GvR (in the acceptance thread for 3333 on Web-SIG),
so here's hoping this will be a good year.

~~~
the_mitsuhiko
> I really hoped Armin would come around, and I committed to Werkzeug for a
> new project with eyes on 3.

All commits to Werkzeug are currently happening with a port to Python 3 in
mind. However I am not going to do the same mistake the standard library made
in many parts and change the semantics of the library for Python 3 and
trusting 2to3 to do the correct thing.

A full port of Werkzeug to Python 3 will take time but it will happen
eventually. The point here is that everybody should go with Python 2.7 and
write the code forwards compatible. Then you have all the options (of going
with PyPy if you need and upgrading to Python 3 if it's worth the effort).

All I can say right now is that so far users are not too eager with Python 3
yet and I have limited resources as well. If anyone wants to help out, I am
more than happy to assist in any way possible to make Werkzeug run on Python
3. I also monitor changes in the stdlib that could affect WSGI on Python 3, so
it's not that I'm ignoring it.

Python is _not_ on the way to suicide. All I said was that _right now_ you
shouldn't be too concerned with Python 3 yet and instead make your own code
upwards compatible. If your base Python version is 2.7 upgrading will not be
the biggest problem, especially not if you are working on a high level like
you do when you use a web framework.

~~~
jedsmith
> I have limited resources as well

I'd like to make clear that I wasn't bitching, because I know _exactly_ how
the limited resources dance goes. Disappointment with further confusion
between Python 2 and 3, yes; disappointment with you, no (are you kidding?
half my stack is Pocoo stuff).

> All I said was that right now you shouldn't be too concerned with Python 3
> yet

The real question is when "yet" will be. Python 3's been out two years, and I
don't think I'm alone in the community in wondering if it'll ever be
completely figured out. The fact that PEP 3333 was _just_ accepted is a
testament to the slow nature of the thing.

It's getting tiring to want to use 3 but instead having to stick with 2to3.
Even that is a distant goal: when will I be able to finally _run_ 2to3 and
move entirely to 3? If I'm entrenched in a lot of Python 2 libraries, I'm
beginning to believe (two years later) that the big day will never come.

Python 3 is great. I want to use it. It's fights like Web3 vs. WSGI and the
resistance to (or impossibility of) porting the libraries I use that are
personally keeping me away from it. I think that speaks for the lack of
eagerness to move to 3 that you've observed. It's very real, and entirely, I
think, due to libraries.

I'll be at PyCon as well on behalf of my employer, and I'm interested (as it
sounds like you are, from your blog post) to hear what the consensus is on
Python's future. Right now, I have a lot of questions, and nobody seems to
have answers.

~~~
jnoller
We have had answers for the past two years: Python 3 adoption will be measured
in terms of _years_ and will only come as third party modules (such as Numpy,
Scipy, and many others) slowly make the port.

No one has ever claimed it to be publicly ready for product, but more and more
libraries are porting every single day - forward progress is being made, but
like all change in the community, it takes time.

I'm a core developer: and even I stick to python 2 right now because of my
dependencies. I know full well that me being able to run Python 3 in
production is at least another year, to two years off.

~~~
jedsmith
That's what I've been told for the last two years -- it'll come, give it time,
etc. Then the developer of a library I use announces that a port to Python 3
is unlikely two years after Python 3 is released, and I'm left with even more
questions.

I'm curious since you continue to advise patience how you'd react in my
position. I've been patient, and now my library of choice for WSGI coming to
Python 3 is, quote, "unlikely". What now? Why should _I_ bother caring about
3, if an influential voice in the Python community doesn't? Armin makes
excellent points in his post, to be frank.

The fault line is widening, honestly, because of the lack of forward momentum.
Your estimate of Python 3 in production being a year to two years off sounds
like it come completely out of thin air, as I'm starting to wonder if it will
_ever_ happen.

~~~
jnoller
Brett and I were just discussing this - and he put up a post summing it up
nicely: [http://sayspy.blogspot.com/2011/01/my-semi-regular-
reminder-...](http://sayspy.blogspot.com/2011/01/my-semi-regular-reminder-
that-python-3.html)

Short version? We planned on it taking at least _5_ years. Armin's point is
that Python 3 isn't "there yet" in terms of demand an adoption. Python 3.2
(which increases performances, and fixes bugs) is just coming out. Armin's
point - backed by his comments here, is just that demand isn't high enough
_for him_ to dedicate the resources to port.

On the other hand, earlier today he was committing bug fixes to the Python 3
source tree, so there's obvious forward movement.

~~~
jedsmith
That's a good post, and I'm glad Brett took the time to share his thoughts.
Characterizing me personally as a naysayer is missing my point entirely.
Throughout this whole thread, I've mentioned that I have _questions_. The
closest I got to naysaying was a rhetorical "why should I care about 3?".
Perhaps that's frustration of others boiling over into his response, but given
that my comments were really the catalyst for the post (presumably), I was
surprised to read it that way.

Brett, Armin, you, Guido, and the rest of the "in" Python developers expected
a long turnaround. I understand that now. Brett touched on something, though:
that 5-year estimate was on _python-dev_. That internal discussion does not
percolate up to the rest of us that use Python daily but only lightly pay
attention to the development ins and outs. I have learned a valuable lesson
from this entire thing, which is that I need to pay attention to all of my
tools.

How many end users does Brett expect to read python-dev?

You have to look at this from the perspective of a casual user, or perhaps
even a user just getting started with Python today.

People always rush to the newest version, and the "Python 2 or 3?" link on
python.org is all the way at the bottom, below even Merchandise. (It should be
above the download links, in my opinion.) <http://www.python.org/download/>
also attempts to very lightly dissuade the user from getting 3:

> they're both considered stable production releases.

> If you don't know which version to use, start with Python 2.7

Those are both true statements, but one can be read as going against the
other. Assuming they miss that -- which can be easily blamed on the user, I
guess -- new users end up playing around with the Python tutorial in IDLE
under Python 3. Maybe a few scripts and adoption of Python 3 specific idioms.
Then a friend mentions Django, but wait ... Django doesn't have Python 3
support yet. Now they're confused. What now? Oh, they have to use Python 2
instead, but a lot of code that they've written so far doesn't work under
Python 2.

In my very humble opinion, I believe this is a poor time to get started with
Python. This transition is hurting new adoption, and there is an incentive to
get it finished as quickly as possible. What I don't gather from library
developers is a sense of urgency to fix it, and my evidence to that end would
probably be the acceptance of PEP 3333 taking ages among other disagreements.
The immediate response that I anticipate is _well, we don't have the
resources_ , but what I gather from other Python developers like me is that
this confusion is hurting more than helping.

I'm honestly not sure how I would have done this differently, and I don't
claim to have enough wisdom to even know where I'd begin. My initial question
would be, if Python 3 had a 5-year outlook for libraries being ready, why
wasn't it stabilized and kept in development for, say, 4 of those years? Was
the general release necessary in order to port libraries and get distributions
on board with packaging? _I_ understand which I should pick because I have
Python experience. A flood of new users probably do not, and comments
elsewhere in this thread (such as the suicide one) just demonstrate even more
confusion about the entire thing.

Obviously, I fully realize that it's unfair to hold a language back because
the libraries need a transition period. However, Python without a library (
_particularly_ for Web development) only gets you so far, and the burden is on
the library authors now.

I guess the underlying thought is that if Python 3 is given first-class
treatment on the python.org brochure, an uninformed user might expect that a
choice between the two is unnecessary. That there is a choice that must be
made just serves to confuse and alienate users.

My two cents, and I'm probably off base anyway.

~~~
jnoller
Since you took the time to write such a big reply - I owe you the same
courtesy. First: I'm not referring to you as a naysayer, just trying to
clarify the timeline (both expected and perceived). No - your comments were
far from the single catalyst for his post, months of comments built up to that
comment, so don't worry - none of this, or that, was a personal attack against
you.

I concur - the <http://wiki.python.org/moin/Python2orPython3> page needs to be
more prominent. I think the entire download page needs to be junked, and
completely rethought out, but I, not anyone else I know have the time or the
constitution to do it.

So yes, the download page _could be better_ \- but I don't know anyone willing
to change it.

How would _you_ communicate it? Python-dev is public, the plans and designs of
Python 3 are open. The lists are open for questions, and I don't know of a
single core developer who would not take the time to answer questions. We've
made it as public as possible, and reiterated it at every single PyCon, in
every blog post we could, etc.

I completely disagree that this is a poor time to get started with python.
There is no confusion: Use Python 2 unless you can use Python 3. I use python2
every day, and have no intention of switching to 3 in production before Django
and several other things port over.

The python community (see PEPs, the moratorium, web-sig discussions) moves
relatively slowly. We get something that works and then we slowly begin to
move towards something else. A lot of discussion, and a lot of thought goes
into each step.

For example, yes: the general release was necessary - we need an official
release for people to even pay attention. We need an official release for OS
distributions to even _consider_ picking it up and shipping it _alongside_
existing Python 2 installs.

Yes, the fact that a choice has to be made sucks: but we, those of us in
"core" can do nothing but encourage and help with porting where we can, the
PSF can sponsor sprints, and we can bide our time.

As for the length of time to get PEP 3333 accepted? Go look at the web-sig
archives to find out way. No decision in the community is made without intense
and thorough debate.

Finally, I can understand your frustration - its frustrating I have to keep
repeating myself because this confusion exists. But I can sum my opinion
really simply: Use Python 2.7 until more libraries and frameworks port.

Everyone is open to how we can improve communication: but we're also short on
resources. I do what I can commenting in places like here, and trying to
explain to people who don't know.

So, I hope that this "confusion" isn't hurting adoption: we've tried to
explain things time and time again, only time and framework/tool and libraries
authors porting can help at this point.

------
civilian
>>So let me reiterate my suggestion for Python 3 in web applications: don't
use it just yet, but write your code in a way that it could pass through 2to3.

Is there a good article for summarizing how I write Python2 code that is
compatible Python3? I mean, what things do I avoid in Python2 to write good
Python3 code? (And while I'm asking dumb questions: how do I make blocks of
text italic on HN?)

~~~
SoftwareMaven
Best resource I know if is to look at what the 2to3 tool does and try to
minimize those items. Many items it fixes are possible to do correctly in 2.6+
(e.g. _print(x)_ instead of _print x_ , even if print still doesn't evaluate
as an expression in 2.x).

<http://docs.python.org/library/2to3.html#to3-fixers>

~~~
jacobolus
You can use:

    
    
      from __future__ import print_function
    

And then print() should work as expected in Python 2.6+. That is, print(1, 2,
3) will print '1 2 3' instead of '(1, 2, 3)'.

------
Luyt
There seems to be a obsession with version numbers: People perceive these as
if they must always have the latest/greatest. For example, when MSSQL 2008
came out, the database admin at a company I work for upgraded the MSSQL 2005
database to it, breaking a few applications due to incompatibilities. Version
2008 offered no features we were planning to use, so from an operational
standpoint it was completely unnecessary. But it was motivated just because of
the higher version number.

The same with Python2 and Python3. Python3 just exists out there so library
developers can port their code over to it. It isn't meant to be used in
production yet, and people learning Python are advised to learn Python2, not
3. Yet time and time again people choose version 3 to begin with 'because it
must be better since it's 3 and everyone knows 3 is better than 2' (the most
often heard reason on the #python IRC channel), thereby making it more
difficult for themselves than necessary.

~~~
cookiecaper
Python 3 is much more than a version number increment. Newbies are advised to
use Py2 only because there are more libraries available for 2, and newbies are
more likely to need more libraries. This is changing slowly but surely as more
libraries go to 3.

2.7 is the last major release in the Py2 line. It's all Py3 from here on out,
so people are starting to take Py3 seriously, as they rightly should. Python 3
is now the default distribution in Arch Linux and other bleeding-edge distros
will be following soon. I'm kind of disappointed the major shift didn't start
happening earlier, though the long cycle was to be expected.

"Stable" and "production-ready" Python 3 releases have been out for about two
years now, by the way, so this definitely isn't a case of everyone jumping
over just for a higher version number, and Python 3 has been "battle tested"
for a while. I'm sure as the real heavyweights like Scipy start seeing real
Py3 usage, cpython3 will get a lot of fixes and improvements.

We're just starting to hit "conversion critical mass" where everyone is
beginning to see it's important to upgrade Py3 soon. I would guess in the next
year most major projects will have ports underway if not completed, so the
Python world will be undergoing a major transition this year, which may
complicate things for a while but is for the long-term good of the community.
:)

------
cdavid
This is a good article, of interest to people even outside web dev in the
python community. I did not know that python 3.1 was that much slower than
python 2.x (python 3.0 was, but this was well known from everyone).

His point about writing new python 2 code for easy 2to3 application is a good
one: porting existing projects to python 3 is quite difficult, because it
cannot always be done without breaking API, but writing new code which can be
easily ported is much easier. There still needs better support to easily use
2to3 and test its output in an automated fashion.

I am also delighted to see known python hackers to recognize the lack of
python 3 usage, and that maybe the roadmap needs to be somehow modified.

~~~
jackdied
The roadmap doesn't need to be modified. The roadmap has always been "the
transition will take five years."

~~~
cdavid
Where are you taking this five years number ?

The roadmap has already changed, BTW. At some point, the plan was to have
python 2.x such as to convert so that python 2.x will be very close to python
3, plan which was abandoned AFAIK (I can certainly understand why, though,
since it would have required a lot of non-fun work).

------
mcav
I'm surprised how many times Mark Pilgrim's quote has been taken out of
context.

------
jnoller
See also: <http://news.ycombinator.com/item?id=2131214>

