Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7306 > unrolled thread

Python 2.6 OR 3.2

Started byhisan <santosh.ssit@gmail.com>
First post2011-06-09 10:18 -0700
Last post2011-06-13 16:17 -0700
Articles 14 — 12 participants

Back to article view | Back to comp.lang.python


Contents

  Python 2.6 OR 3.2 hisan <santosh.ssit@gmail.com> - 2011-06-09 10:18 -0700
    Re: Python 2.6 OR 3.2 John Gordon <gordon@panix.com> - 2011-06-09 17:22 +0000
      Re: Python 2.6 OR 3.2 "Kyle T. Jones" <onexpadREMOVE@EVOMERyahoodotyouknow.com> - 2011-06-09 22:41 -0500
        Re: Python 2.6 OR 3.2 Terry Reedy <tjreedy@udel.edu> - 2011-06-09 23:56 -0400
          Re: Python 2.6 OR 3.2 harrismh777 <harrismh777@charter.net> - 2011-06-10 00:49 -0500
    Re: Python 2.6 OR 3.2 Corey Richardson <kb1pkl@aim.com> - 2011-06-09 15:36 -0400
    Re: Python 2.6 OR 3.2 Chris Angelico <rosuav@gmail.com> - 2011-06-10 08:48 +1000
    Re: Python 2.6 OR 3.2 Andrew Berg <bahamutzero8825@gmail.com> - 2011-06-09 23:01 -0500
      Re: Python 2.6 OR 3.2 harrismh777 <harrismh777@charter.net> - 2011-06-10 01:00 -0500
        Re: Python 2.6 OR 3.2 Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-06-10 00:15 -0700
        Re: Python 2.6 OR 3.2 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-10 09:48 +0000
          Re: Python 2.6 OR 3.2 SigmundV <sigmundv@gmail.com> - 2011-06-13 16:08 -0700
            Re: Python 2.6 OR 3.2 Chris Angelico <rosuav@gmail.com> - 2011-06-14 09:13 +1000
        Re: Python 2.6 OR 3.2 geremy condra <debatem1@gmail.com> - 2011-06-13 16:17 -0700

#7306 — Python 2.6 OR 3.2

Fromhisan <santosh.ssit@gmail.com>
Date2011-06-09 10:18 -0700
SubjectPython 2.6 OR 3.2
Message-ID<9037ef5f-53c5-42c6-ac5d-8f942df6ccc5@x38g2000pri.googlegroups.com>
Hi All,

Please let me know which one is GOOD whether Python 2.6 OR 3.2.
Please let me know the difference between them.
Please give some refernce site or books to know the difference

[toc] | [next] | [standalone]


#7308

FromJohn Gordon <gordon@panix.com>
Date2011-06-09 17:22 +0000
Message-ID<isqvha$heg$1@reader1.panix.com>
In reply to#7306
In <9037ef5f-53c5-42c6-ac5d-8f942df6ccc5@x38g2000pri.googlegroups.com> hisan <santosh.ssit@gmail.com> writes:

> Hi All,

> Please let me know which one is GOOD whether Python 2.6 OR 3.2.
> Please let me know the difference between them.
> Please give some refernce site or books to know the difference

If you're starting new, use 3.2.  All code will eventually move to this
newer style, so you'll have to learn it eventually.

The only reason to use 2.6 is if you have to maintain an existing code
base that was written with 2.6 (or older).

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

[toc] | [prev] | [next] | [standalone]


#7344

From"Kyle T. Jones" <onexpadREMOVE@EVOMERyahoodotyouknow.com>
Date2011-06-09 22:41 -0500
Message-ID<iss3pq$osj$1@dont-email.me>
In reply to#7308
John Gordon wrote:
> In <9037ef5f-53c5-42c6-ac5d-8f942df6ccc5@x38g2000pri.googlegroups.com> hisan <santosh.ssit@gmail.com> writes:
> 
>> Hi All,
> 
>> Please let me know which one is GOOD whether Python 2.6 OR 3.2.
>> Please let me know the difference between them.
>> Please give some refernce site or books to know the difference
> 
> If you're starting new, use 3.2.  All code will eventually move to this
> newer style, so you'll have to learn it eventually.
> 
> The only reason to use 2.6 is if you have to maintain an existing code
> base that was written with 2.6 (or older).
> 

Library support.

Cheers.

[toc] | [prev] | [next] | [standalone]


#7345

FromTerry Reedy <tjreedy@udel.edu>
Date2011-06-09 23:56 -0400
Message-ID<mailman.72.1307678201.11593.python-list@python.org>
In reply to#7344
On 6/9/2011 11:41 PM, Kyle T. Jones wrote:

> Library support.

I urge people who use 2.x only for library support to let library 
authors that they would have preferred a 3.x compatible library. I have 
library authors say "Why port when none of my users have asked for a port?"

A couple of years ago, users were people who were already programming 
with 2.x. That is changing now.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#7356

Fromharrismh777 <harrismh777@charter.net>
Date2011-06-10 00:49 -0500
Message-ID<gfiIp.2325$8G4.355@newsfe17.iad>
In reply to#7345
Terry Reedy wrote:
> A couple of years ago, users were people who were already programming
> with 2.x. That is changing now.

  ... big time !


:)

[toc] | [prev] | [next] | [standalone]


#7314

FromCorey Richardson <kb1pkl@aim.com>
Date2011-06-09 15:36 -0400
Message-ID<mailman.60.1307648278.11593.python-list@python.org>
In reply to#7306
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/09/2011 01:18 PM, hisan wrote:
> Hi All,
> 
> Please let me know which one is GOOD whether Python 2.6 OR 3.2.
> Please let me know the difference between them.
> Please give some refernce site or books to know the difference

http://wiki.python.org/moin/Python2orPython3

Pick one and learn it well. It'll be easy to switch to the other when/if
you need to. Right now lots of nice libraries only support 2.x, like
Twisted and lots of web frameworks (all? I think there's one or two that
use 3).

- -- 
Corey Richardson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iQEcBAEBAgAGBQJN8SDNAAoJEAFAbo/KNFvpbewH/3IclMl/K5d35qsVesoYuICB
pFt0W6gxyMSRMU2TcoYbpsSVlqjc+KCwUQ7wxv/yIw8ldXs09IV3ITbajKDR2Gnh
TX5DdgRaC8vAoQHLuvjUvJST0/1INnK/sYGnzS1xuNv5uuohqZ026jx4HEXTfjUi
haI/bFLELM9iKrBjuSRKYVy4RYRHAE0ziKblbXtfNTltU0Y2C56xRKkMplsEk/pV
ka+6R5OkHvMap+g++TRaXqN347m60GnWKWYwTklcTSyfJmmEtaokE4gJwPodv7N4
ozQrkcNdL3tHxTLFbMfO5zrSrW+yWEpsGRYbUSJIx8zOUOhbyjZJtHBuYu+xsqI=
=4AvK
-----END PGP SIGNATURE-----

[toc] | [prev] | [next] | [standalone]


#7327

FromChris Angelico <rosuav@gmail.com>
Date2011-06-10 08:48 +1000
Message-ID<mailman.63.1307659729.11593.python-list@python.org>
In reply to#7306
On Fri, Jun 10, 2011 at 3:18 AM, hisan <santosh.ssit@gmail.com> wrote:
> Hi All,
>
> Please let me know which one is GOOD whether Python 2.6 OR 3.2.

As a side point, you should probably use 2.7 rather than 2.6. With
regard to 2.x versus 3.x, Corey already posted a link to an excellent
article.

Chris Angelico

[toc] | [prev] | [next] | [standalone]


#7347

FromAndrew Berg <bahamutzero8825@gmail.com>
Date2011-06-09 23:01 -0500
Message-ID<mailman.74.1307678519.11593.python-list@python.org>
In reply to#7306
On 2011.06.09 12:18 PM, hisan wrote:
> Hi All,
>
> Please let me know which one is GOOD whether Python 2.6 OR 3.2.
> Please let me know the difference between them.
> Please give some refernce site or books to know the difference
I'm just a beginner, but AFAICT, there are three reasons to learn Python 2:
- You will need to maintain or add features to a project that is written
in Python 2 and is not easily converted to Python 3.
- You have a project that absolutely depends on something that is
written in Python 2 and is not easily converted to Python 3.
- You are forced to use a 2.x version of the interpreter (e.g., your
employer wants you to create Python scripts that will run on their
server, which runs a 2.x version of the interpreter). In this case, you
should learn the exact version of the interpreter used (some features in
2.7 aren't available in e.g., 2.3).

If none of these apply to you, then 3.2 all the way. Everything is
moving to 3.x - don't use 2.x as a starting point if you don't have to.

[toc] | [prev] | [next] | [standalone]


#7357

Fromharrismh777 <harrismh777@charter.net>
Date2011-06-10 01:00 -0500
Message-ID<7qiIp.3540$lW4.2615@newsfe07.iad>
In reply to#7347
Andrew Berg wrote:
> AFAICT, there are three reasons to learn Python 2:

    ... there is a fourth reason.

The linux distro you are using currently was customized with python 2.x

I ran into this problem this week in fact... on my HP g6 ubuntu notebook 
running 10.04 lucid. It ships with the 2.6.5 interpreter. I installed 
2.7.1 and 3.2 (from sources) and was working along happy as a clam until 
I needed to configure a printer... and the config tools would not 
function... some of them would not even open.  Want to guess?  Yup, the 
config tools are (some of them) written in python 2.6-- and they don't 
run in 2.7.1 nor 3.2  .   :(

So, be careful.  I have had to separate *all* of my python installs on 
*every* one of my systems for this similar reason. The bottom line is if 
the distro ships with 2.6 (minus the idle) chances are that the 
interpreter is there *not* to advocate for python explicitly, but 
because the interpreter is being used by the system somewhere. If you 
install 2.7 or 3.2 you need to be careful to *not* interfere with the 
default setup.

So, you will need to be able to use both.  There is no getting around 
it... but, I would start with 3.2 (seriously). Get 3.2 under your belt 
and then when you need to, go back and deal with the 2.6 regression.

3.2 is better built, is more logically consistent (it really is, no 
kidding), and has some new features that make it very attractive. The 
down-side is that some (most) of the library support is still not there 
for many projects.   It will take some time, but it will happen.



kind regards,
m harris

[toc] | [prev] | [next] | [standalone]


#7359

FromBenjamin Kaplan <benjamin.kaplan@case.edu>
Date2011-06-10 00:15 -0700
Message-ID<mailman.79.1307690143.11593.python-list@python.org>
In reply to#7357
On Thu, Jun 9, 2011 at 11:00 PM, harrismh777 <harrismh777@charter.net> wrote:
> Andrew Berg wrote:
>>
>> AFAICT, there are three reasons to learn Python 2:
>
>   ... there is a fourth reason.
>
> The linux distro you are using currently was customized with python 2.x
>
> I ran into this problem this week in fact... on my HP g6 ubuntu notebook
> running 10.04 lucid. It ships with the 2.6.5 interpreter. I installed 2.7.1
> and 3.2 (from sources) and was working along happy as a clam until I needed
> to configure a printer... and the config tools would not function... some of
> them would not even open.  Want to guess?  Yup, the config tools are (some
> of them) written in python 2.6-- and they don't run in 2.7.1 nor 3.2  .   :(
>
> So, be careful.  I have had to separate *all* of my python installs on
> *every* one of my systems for this similar reason. The bottom line is if the
> distro ships with 2.6 (minus the idle) chances are that the interpreter is
> there *not* to advocate for python explicitly, but because the interpreter
> is being used by the system somewhere. If you install 2.7 or 3.2 you need to
> be careful to *not* interfere with the default setup.
>
> So, you will need to be able to use both.  There is no getting around it...
> but, I would start with 3.2 (seriously). Get 3.2 under your belt and then
> when you need to, go back and deal with the 2.6 regression.
>
> 3.2 is better built, is more logically consistent (it really is, no
> kidding), and has some new features that make it very attractive. The
> down-side is that some (most) of the library support is still not there for
> many projects.   It will take some time, but it will happen.
>
>

There's an altinstall make target that you're supposed to use in cases
like this. It won't make the /usr/local/bin/python symlink (or
whatever prefix you're using), just pythonx.y. This way, the programs
that depend on "python" referring to a specific version will still
continue to work and you can have your newer version. The Ubuntu
packages that depend on the system Python+ system installed packages
*should* be specifying /usr/bin/python specifically but as you can
see, they don't always do that.

>
> kind regards,
> m harris
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

[toc] | [prev] | [next] | [standalone]


#7368

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2011-06-10 09:48 +0000
Message-ID<4df1e86b$0$29977$c3e8da3$5496439d@news.astraweb.com>
In reply to#7357
On Fri, 10 Jun 2011 01:00:35 -0500, harrismh777 wrote:

> So, be careful.  I have had to separate *all* of my python installs on
> *every* one of my systems for this similar reason. The bottom line is if
> the distro ships with 2.6 (minus the idle) chances are that the
> interpreter is there *not* to advocate for python explicitly, but
> because the interpreter is being used by the system somewhere. If you
> install 2.7 or 3.2 you need to be careful to *not* interfere with the
> default setup.

Yes.

Never mess with the system Python unless you want to take full 
responsibility for fixing the system when it breaks :)



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#7570

FromSigmundV <sigmundv@gmail.com>
Date2011-06-13 16:08 -0700
Message-ID<6aec1f7b-e929-4750-bbd2-61488308590d@a7g2000vby.googlegroups.com>
In reply to#7368
I'm using 2.7.1, because that's what my Ubuntu 11.04 bundles (python --
version reports 2.7.1+ though, no idea what the + means). On the other
hand, Ubuntu provides 3.2 packages via apt-get, so I'm in the process
of migrating to 3k. I really like the focus on laziness in 3k (don't
know if 'focus' is the right word though, but there definitely are
more lazy features in 3k). E.g. it's great that map and filter return
iterators now (yes, I use them, how Guido finds them confusing is
beyond me).

To the OP I'd say: learn Python through 3.2. It's the best way
forward, for the sake of yourself and others. The only way more
modules can become 3k compatible is if more people use 3k.

/Sigmund

[toc] | [prev] | [next] | [standalone]


#7572

FromChris Angelico <rosuav@gmail.com>
Date2011-06-14 09:13 +1000
Message-ID<mailman.204.1308006783.11593.python-list@python.org>
In reply to#7570
On Tue, Jun 14, 2011 at 9:08 AM, SigmundV <sigmundv@gmail.com> wrote:
> To the OP I'd say: learn Python through 3.2. It's the best way
> forward, for the sake of yourself and others. The only way more
> modules can become 3k compatible is if more people use 3k.

I skipped 3.2 and went straight to 3.3a0 from hg, but that's because
I'm comfortable with compiling my own :)

ChrisA

[toc] | [prev] | [next] | [standalone]


#7573

Fromgeremy condra <debatem1@gmail.com>
Date2011-06-13 16:17 -0700
Message-ID<mailman.205.1308007054.11593.python-list@python.org>
In reply to#7357
On Thu, Jun 9, 2011 at 11:00 PM, harrismh777 <harrismh777@charter.net> wrote:
> Andrew Berg wrote:
>>
>> AFAICT, there are three reasons to learn Python 2:
>
>   ... there is a fourth reason.
>
> The linux distro you are using currently was customized with python 2.x
>
> I ran into this problem this week in fact... on my HP g6 ubuntu notebook
> running 10.04 lucid. It ships with the 2.6.5 interpreter. I installed 2.7.1
> and 3.2 (from sources) and was working along happy as a clam until I needed
> to configure a printer... and the config tools would not function... some of
> them would not even open.  Want to guess?  Yup, the config tools are (some
> of them) written in python 2.6-- and they don't run in 2.7.1 nor 3.2  .   :(

Just a note, Ubuntu 11.04 has 2.7 preinstalled.

Geremy Condra

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web