Prev: Ad hoc lists vs ad hoc tuples
Next: Python and Ruby
From: sjdevnull on 27 Jan 2010 16:14 On Jan 27, 9:22 am, Daniel Fetchinson <fetchin...(a)googlemail.com> wrote: > >> Hi folks, > > >> I was going to write this post for a while because all sorts of myths > >> periodically come up on this list about python 3. I don't think the > >> posters mean to spread false information on purpose, they simply are > >> not aware of the facts. > > >> My list is surely incomplete, please feel free to post your favorite > >> misconception about python 3 that people periodically state, claim or > >> ask about. > > >> 1. Print statement/function creates incompatibility between 2.x and 3.x! > > >> Certainly false or misleading, if one uses 2.6 and 3.x the > >> incompatibility is not there. Print as a function works in 2.6: > > >> Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) > >> [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 > >> Type "help", "copyright", "credits" or "license" for more information. > >>>>> print( 'hello' ) > >> hello > >>>>> print 'hello' > >> hello > > >> 2. Integer division creates incompatibility between 2.x and 3.x! > > >> Again false or misleading, because one can get the 3.x behavior with 2..6: > > >> Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) > >> [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 > >> Type "help", "copyright", "credits" or "license" for more information. > >>>>> 6/5 > >> 1 > >>>>> from __future__ import division > >>>>> 6/5 > >> 1.2 > > >> Please feel free to post your favorite false or misleading claim about > >> python 3! > > > Well, I see two false or misleading claims just above - namely that > > the two claims above are false or misleading. They tell just half of > > the story, and that half is indeed easy. A Python 3 program can be > > unchanged (in the case of print) or with only trivial modifications > > (in the case of integer division) be made to run on Python 2.6. > > Okay, so we agree that as long as print and integer division is > concerned, a program can easily be written that runs on both 2.6 and > 3.x. > > My statements are exactly this, so I don't understand why you disagree. > > > The other way around this is _not_ the case. > > What do you mean? > > > To say that two things are > > compatible if one can be used for the other, but the other not for the > > first, is false or misleading. > > I'm not sure what you mean here. Maybe I didn't make myself clear > enough, but what I mean is this: as long as print and integer division > is concerned, it is trivial to write code that runs on both 2.6 and > 3.x. Hence if someone wants to highlight incompatibility (which surely > exists) between 2.6 and 3.x he/she has to look elsewhere. I think you're misunderstanding what "compatibility" means in a programming language context. Python 3 and Python 2 are not mutually compatible, as arbitrary programs written in one will not run in the other. The most important fallout of that is that Python 3 is not backwards compatible, in that existing Python 2 programs won't run unaltered in Python 3--while it's easy to write a new program in a subset of the languages that runs on both Python 2 and 3, the huge existing codebase of Python 2 code won't run under Python 3. That there exists an intersection of the two languages that is compatible with both doesn't make the two languages compatible with each other--although it being a fairly large subset does help mitigate a sizable chunk of the problems caused by incompatibility (as do tools like 2to3). In your example, a python2 program that uses print and division will fail in python3. The print problem is less significant, since the failure will probably be a syntax error or a rapid exception raised. The division problem is more problematic, since a program may appear to run fine but silently misbehave; such errors are much more likely to result in significant damage to data or other long-term badness.
From: Ben Finney on 27 Jan 2010 16:20 John Nagle <nagle(a)animats.com> writes: > Myths about Python 3: > > 1. Python 3 is supported by major Linux distributions. > > FALSE - most distros are shipping with Python 2.4, or 2.5 at > best. There's a big difference between “What list of versions of Python does <fooOS> ship with?” versus “Which one version of Python does <fooOS> use for its implementation of 'python'?”. I think the latter is the more pertinent question. Do you have evidence to back up a claim (not that I'm saying you have necessarily made the claim; it's not clear from what you wrote) that most operating systems use Python 2.4 as their implementation of 'python'? -- \ “Anyone who believes exponential growth can go on forever in a | `\ finite world is either a madman or an economist.” —Kenneth | _o__) Boulding | Ben Finney
From: Benjamin Kaplan on 27 Jan 2010 16:25 On Wed, Jan 27, 2010 at 3:56 PM, John Nagle <nagle(a)animats.com> wrote: > Daniel Fetchinson wrote: >> >> Hi folks, >> >> I was going to write this post for a while because all sorts of myths >> periodically come up on this list about python 3. I don't think the >> posters mean to spread false information on purpose, they simply are >> not aware of the facts. >> >> My list is surely incomplete, please feel free to post your favorite >> misconception about python 3 that people periodically state, claim or >> ask about. > > Myths about Python 3: > > 1. Python 3 is supported by major Linux distributions. > > FALSE - most distros are shipping with Python 2.4, or 2.5 at best. > The latest versions of Ubuntu Jaunty and Karmic, Fedora 11 and 12, and OpenSUSE 11.2 all use Python 2.6. Ubuntu has been shipping python 3 since Jaunty came out last April. According to Fedora's package index, Python 3 is in the devel version which probably means it will be in upcoming versions of Fedora as well. > 2. Python 3 is supported by multiple Python implementations. > > FALSE - Only CPython supports 3.x. Iron Python, Unladen Swallow, > PyPy, and Jython have all stayed with 2.x versions of Python. > When Python 2.6 came out, Jython was still on 2.2. The difference between 2.2 and 2.6 is almost as big of a difference as between 2.6 and 3.0. In that time, you had the introduction of the boolean type, generators, list comprehensions, the addition of the "yield" and "with" keywords, universal newline support, and decorators in addition to the large number of changes to the standard library such as the introduction of the subprocess module. > 3. Python 3 is supported by most 3rd party Python packages. > > FALSE - it's not supported by MySQLdb, OpenSSL, feedparser, etc. > > Arguably, Python 3 has been rejected by the market. Instead, there's > now Python 2.6, Python 2.7, and Python 2.8. Python 3 has turned into > a debacle like Perl 6, now 10 years old. > Give the package maintainers time to update. There were some pretty big changes to the C API. Most of the major 3rd party packages like numpy and MySQLdb have already commited to having a Python 3 version. They just haven't gotten them out yet. > That's the reality, Python 3 fanboys. > > John Nagle > -- > http://mail.python.org/mailman/listinfo/python-list >
From: Christian Heimes on 27 Jan 2010 16:26 John Nagle wrote: > 1. Python 3 is supported by major Linux distributions. > > FALSE - most distros are shipping with Python 2.4, or 2.5 at best. You are wrong. Modern versions of Debian / Ubuntu are using Python 2.6. My Ubuntu box has python3.0, too. > 2. Python 3 is supported by multiple Python implementations. > > FALSE - Only CPython supports 3.x. Iron Python, Unladen Swallow, > PyPy, and Jython have all stayed with 2.x versions of Python. You are wrong again. We have an active discussion on the Python developer mailinglist to integrate Unladen Swallow into py3k, see http://jessenoller.com/2010/01/06/unladen-swallow-python-3s-best-feature/ .. The other implementations have been planing Python 3.x support for more than a year. > > 3. Python 3 is supported by most 3rd party Python packages. > > FALSE - it's not supported by MySQLdb, OpenSSL, feedparser, etc. Python 3.x has builtin support for several aspects of OpenSSL. Other important projects like Cython, lxml, some Postgres DBAs, Django, mod_wsgi and many more have been ported to Python 3.x for more than a year. In fact Graham has helped us to identify several issues in 3.0 beta while he was porting mod_wsgi to Python 3.0. (Personally I neither see MySQL as mission critical nor as a powerful RDBMS. Just try to combine foreign keys with triggers and you'll see what I'm talking about. *scnr*) Christian
From: Ben Finney on 27 Jan 2010 16:30
Adam Tauno Williams <awilliam(a)opengroupware.us> writes: > On Wed, 2010-01-27 at 12:56 -0800, John Nagle wrote: > > 2. Python 3 is supported by multiple Python implementations. > > FALSE - Only CPython supports 3.x. Iron Python, Unladen Swallow, > > PyPy, and Jython have all stayed with 2.x versions of Python. > > And of all Python development what percentage takes place on all those > combined? That's irrelevant to the point, though. Regardless of how small the minority of developers on the platform, it clearly matters to those developers which versions of Python they can use. -- \ “When I get new information, I change my position. What, sir, | `\ do you do with new information?” —John Maynard Keynes | _o__) | Ben Finney |