Live data from Hacker News

Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

news.ycombinator.com

11–20 of 29 posts

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#11
post #5

http://wiki.python.org/moin/Python2orPython3 was created recently to answer just such a question, quite recently in fact (some people were asking similar questions and the issue of the quality of the stock answers was raised in comp.lang.python).

http://docs.python.org/release/3.0.1/whatsnew/3.0.html this is down. It was linked in the above article.

Google cache: http://webcache.googleusercontent.com/search?q=cache:dqDQ-qw...

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#12
post #9

Earlier quoted context omitted.

less cynically ... perhaps the poster wanted the personal opinions of HN hackers, many of whom probably have first-hand experience with Python and might be able to give more personalized answers than what's on FAQ pages

ahhh, k. so if that's the case, here's what I should do. i'll begin preparing a series of questions to post to HN in the coming weeks, to keep in the same spirit. Rough list to start with: 1. where do babies come from? 2. what is PageRank? 3. what sorts of languages can you write iPhone apps in such that they are allowed in the Apple store? 4. why might I want to write an app in C versus in BASIC? i'll add more as th…

Actually, if you went one step beyond and asked for opinions or non-obvious answers to any of those, I'd consider that perfectly suitable for the site.

For example

2. is there an open source implementation of PageRank?

3. any tips on how to fake handwritten Objective C so Apple will accept my app?

4. I wrote my app in BASIC instead of Objective C and Steve Jobs said it was okay

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#14
Google App Engine SDK uses Python 2.5, I had 2.6 installed and had to revert. 3 drops some features, adds some others. You can import 3.x features in 2.x from __future__, see: http://docs.python.org/library/__future__.html

One of the less useful features dropped is 'somestring'.encode('rot13') :P

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#15

Earlier quoted context omitted.

ahhh, k. so if that's the case, here's what I should do. i'll begin preparing a series of questions to post to HN in the coming weeks, to keep in the same spirit. Rough list to start with: 1. where do babies come from? 2. what is PageRank? 3. what sorts of languages can you write iPhone apps in such that they are allowed in the Apple store? 4. why might I want to write an app in C versus in BASIC? i'll add more as th…

Actually, if you went one step beyond and asked for opinions or non-obvious answers to any of those, I'd consider that perfectly suitable for the site. For example 2. is there an open source implementation of PageRank? 3. any tips on how to fake handwritten Objective C so Apple will accept my app? 4. I wrote my app in BASIC instead of Objective C and Steve Jobs said it was okay

here are some more common patterns that HN seems to find acceptable:

1. Google?

2. Facebook Apple?

3. when will do ?

:P

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#16
Both are stable. Both will continue to be stable for a long time.

The main difference lies with third party library support. There are a number of third party libraries that don't work with Python 3 yet. They will get ported eventually. If you want to use a library that doesn't support 3, then the choice is made for you.

The second difference lies with Linux distributions. On most distros you can just install the "python3" package and everything works, on a few distros you'll have to install Python 3 yourself or hunt down the right package repository (my info may be a year behind or so, I'm not sure). This also applies to third party libraries -- even if the library supports Python 3, your distro might not have a package for it, even if it has a package for that library for Python 2.

It's fairly easy (most of the time) to write code for Python 2.x that converts to Python 3 code with the bundled "2to3" converter. I do this for any script I might ever want to give to someone else or run on a computer that's not mine. Otherwise, I just write straight Python 3 code. Assuming, of course, that I don't need some library.

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#17
If you have to ask, I would highly recommend 2.x ! Nobody of note is using 3.x in production. It's nice, but not backwards compatible with the huge pool of existing code / docs; which is one of python's strongest suits, especially if you're coming to the language fresh.

The IRC /topic: ;)

""" Topic for #python: NO LOL | Don't paste in here: use http://paste.pocoo.org/ | http://pound-python.org/ | Include Python version in questions |

2.x or 3.x? http://tinyurl.com/python2or3 |

Tutorial: http://docs.python.org/tut/ | FAQ: http://effbot.org/pyfaq/ | New Programmer? http://tinyurl.com/thinkcspy2e | #python-fr #python.de #python-es #python.tw #python.pl #python-br #python-nl #python-ir """

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#18

Earlier quoted context omitted.

Actually, if you went one step beyond and asked for opinions or non-obvious answers to any of those, I'd consider that perfectly suitable for the site. For example 2. is there an open source implementation of PageRank? 3. any tips on how to fake handwritten Objective C so Apple will accept my app? 4. I wrote my app in BASIC instead of Objective C and Steve Jobs said it was okay

here are some more common patterns that HN seems to find acceptable: 1. Google? 2. Facebook Apple? 3. when will do ? :P

here's one more to add to your list: if you do an automated text meta-analysis of "Ask HN" titles and see what words/phrases are correlated with more upvotes, then post your analysis on a blog post, i'm sure people would upvote you like crazy ;)

Re: Ask HN: Why are there 2 Pythons? (2.7 & 3.1.2)

#19

Both are stable. Both will continue to be stable for a long time. The main difference lies with third party library support. There are a number of third party libraries that don't work with Python 3 yet. They will get ported eventually. If you want to use a library that doesn't support 3, then the choice is made for you. The second difference lies with Linux distributions. On most distros you can just install the "py…

> They will get ported eventually.

This is what worries me about Python: Python3 has been stable for a long while now, yet major projects (SciPy, Django) remain on 2.x, with no clear deadline for being ported to Python 3.

Contrast this to Ruby, where Rails 3 is 1.8-compatible but recommends 1.9. Ruby 1.9 is being used in production even though it's not completely stable yet. In short, Ruby is clearly evolving, major libraries are constantly being updated for the latest version of the language, and everyone in the Ruby community has a strong sense of "getting better all the time."

Python 3 is a better language than Python 2. That it's taken so long to become the canonical version makes me wonder about Python's future.

Post reply on HN