Prev: Ad hoc lists vs ad hoc tuples
Next: Python and Ruby
From: Jean-Michel Pichavant on 27 Jan 2010 09:32 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. >>> >>> 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. > > Cheers, > Daniel > > How would you write in python 2.6 if print: print('Hello') --- def myPrint(*args): for arg in args: sys.stdout.write(str(arg)) print = myPrint JM
From: Lie Ryan on 27 Jan 2010 09:42 On 01/28/10 01:32, Jean-Michel Pichavant 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. >>>> >>>> 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. >> >> Cheers, >> Daniel >> >> > How would you write in python 2.6 > > if print: > print('Hello') > > --- > > def myPrint(*args): > for arg in args: > sys.stdout.write(str(arg)) > > print = myPrint > > JM from __future__ import print_function if print: print('Hello') def myPrint(*args): for arg in args: sys.stdout.write(str(arg)) print = myPrint
From: John Nagle on 27 Jan 2010 15:56 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. 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. 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. That's the reality, Python 3 fanboys. John Nagle
From: Grant Edwards on 27 Jan 2010 15:45 On 2010-01-27, John Nagle <nagle(a)animats.com> wrote: > Arguably, Python 3 has been rejected by the market. Let's just say that it hasn't yet been accepted 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. I think I'd have to wait a couple more years before making that sort of pronouncement. That said, I don't expect to start using Python 3 until library availability or my Linux distro forces me to. -- Grant Edwards grante Yow! Inside, I'm already at SOBBING! visi.com
From: Adam Tauno Williams on 27 Jan 2010 16:06
On Wed, 2010-01-27 at 12:56 -0800, John Nagle 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. CentOS: python26-2.6.4-1.ius.parallel.el5 openSUSE: python-2.6.2-6.3.i586, python3-3.1-3.3.i586 Darn, those pesky facts. > 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? 2%? Maybe. |