Here's the link to PEP 405:
Here's the link to PEP 405:
1. Are you doing web development? If so, use Python 2.
2. If not, do you need or want to use PyPy? If so, use Python 2.
3. If not, are the libraries you want available for Python 3? If so, use Python 3.
4. Otherwise, use Python 2. Short version: Python 2.x is the status quo,
Python 3.x is the present and future of the languageHow would one know what to recommend while knowing nothing about `jcurbo`s intentions/designs/requirements?
The stackoverflow and wikipedia communities sometimes get flack about maintaining strict objectivity, and I know the HN community is allowed to be different, but surely you agree that there is no right answer to `jcurbo`s question. And if there is no right answer, surely offering information from a trusted source can be just as helpful (if not moreso).
tl;dr: Python 3.
For someone learning Python? Just give them your best suggestion. Look, it's fairly easy.
Learn Python 3. There are differences, and you might run into issues later on, but once you get to that point, you'll know enough to do something about it.
See, when someone asks whether to learn Python 2 or Python 3, that's what they are asking for. If they are learning for specific reasons (for a job, lets say), then instead of trying to answer, you ask follow up questions. But for learning a language, they are seeking advice from experienced people.
So, when those same experienced people, who already know Python 2 and/or Python 3 tell them to learn Python 2 and/or Python 3, they are being told: we don't know.
And how is someone inexperienced supposed to know which one to learn when experienced people don't know?
Basically, if you can't answer the question because you feel you lack information, ask. Otherwise, answering the question "Learn Python 2 or 3?" with the answer "Learn Python 2 or 3." isn't helpful.
"At the time of writing (July 4, 2010), the final 2.7 release is out, with a statement of extended support for this end-of-life release. The 2.x branch will see no new major releases after that."
Since what I am working on doesn't involve major libraries (like numpy) I see no reason to stay on 2.x and I think I'm safe to look at 3.x for future stuff.
So yes, there are pages doing this new style web right now, but that doesn't change that the mojority of web stuff is the older style. So yeah, the current state of affairs is that the web is mostly outdated.
This is necessarily true always, unless that which is being examined is stagnant.
As someone who was learning Python for fun personal projects rather than serious business projects, I decided to use Python 3 wherever possible, while familiarizing myself with Python 2.7 just in case. It turns out the two versions really aren't all that different. A lot of people will still recommend starting with Python 2.7, since it really is such a small jump from there to using Py3k; I essentially did the opposite. Both approaches work. Finding tooling for Python 3 might still be a challenge (I remember having to fix one or two bugs in IPython before it would run at all), and the usefulness of these tools to a beginner is really the biggest reason why you might want to stick with 2.7 for the moment. But if you're adventurous, I do highly recommend Py3k. Especially with the upcoming 3.3 release (due later this year), I'd argue that Python 3 finally has enough new features (and enough library support) to justify using it full-time.
(When will it be possible to know, beyond doubt, that Python 3 is ready for prime time? When third-party implementations like PyPy and Jython make the jump. I don't know about Jython (which just recently made it to 2.7), but PyPy's working on it as we speak.)
If you're coming from the Ruby scene, think of virtualenv as Python's take on RVM.
I would say start on 2.7, as most of the popular Python libraries are still Python 2.x only, and 2.7 backports some Python 3 features, so you (and your code) will be ready for 3 whenever the world switches over :)
However, I can't find that warning anymore in the second edition, so not sure if he's changed his mind or not.
Make sure you install Python 2 not Python 3.
[1] http://learnpythonthehardway.org/book/ex0.htmlIf you need to ship and launch a software that absolutely depends on libraries that only work with Python 2, it should be rather easy to not use the newer features and go with Python 2.