Re: Python 2.6 OR 3.2

2011-06-13 Thread SigmundV
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-13 Thread Chris Angelico
On Tue, Jun 14, 2011 at 9:08 AM, SigmundV sigmu...@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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-13 Thread geremy condra
On Thu, Jun 9, 2011 at 11:00 PM, harrismh777 harrismh...@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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-10 Thread harrismh777

Terry Reedy wrote:

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


 ... big time !


:)
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-10 Thread harrismh777

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


--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-10 Thread Benjamin Kaplan
On Thu, Jun 9, 2011 at 11:00 PM, harrismh777 harrismh...@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

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-10 Thread Steven D'Aprano
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-09 Thread John Gordon
In 9037ef5f-53c5-42c6-ac5d-8f942df6c...@x38g2000pri.googlegroups.com hisan 
santosh.s...@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
gor...@panix.com  B is for Basil, assaulted by bears
-- Edward Gorey, The Gashlycrumb Tinies

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-09 Thread Corey Richardson
-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-
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-09 Thread Chris Angelico
On Fri, Jun 10, 2011 at 3:18 AM, hisan santosh.s...@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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-09 Thread Dan Stromberg
If your dependencies are satisfiable with 3.2, you're better off with 3.2.

If not, use 2.7, or consider porting the dependencies yourself (assuming
those dependencies have code available).

Both 2.x and 3.x are good, but 3.x is clearly the way forward.

3.x has some annoyances corrected: more central unicode, incompatible types
aren't silently compared in a strange way, a callable can insist on named
arguments, etc.

The best way to learn the difference, IMO, is to develop on both.  You can
do this by using 3to2, using 2to3, or using a common subset.  If you write
automated tests, and set them up to run with one or more 2.x's and one or
more 3.x's, you'll see the differences that matter in your code pretty
quickly.

I've been opting for the common subset, and have been very happy with it.
Lately I'm testing on cpython 2.[567], cpython 3.[012], pypy 1.[45] and
Jython 2.5.2 (the jython with a fix or two patched in).

3to2 sounds like a bit nicer option than 2to3, because 3to2 can start from
code that knows the difference between the two main kinds of strings.

On Thu, Jun 9, 2011 at 10:18 AM, hisan santosh.s...@gmail.com 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://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-09 Thread Kyle T. Jones

John Gordon wrote:

In 9037ef5f-53c5-42c6-ac5d-8f942df6c...@x38g2000pri.googlegroups.com hisan 
santosh.s...@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.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-09 Thread Terry Reedy

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

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.6 OR 3.2

2011-06-09 Thread Andrew Berg
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.
-- 
http://mail.python.org/mailman/listinfo/python-list