[Tutor] Bad time to get into Python?

Thomas Pani thomas.pani at gmail.com
Sun Feb 3 19:56:10 CET 2008


Dotan Cohen wrote:
> However, with the coming of Python3 and the new syntax, is this a bad time to start learning Python?
Not at all, I'd say. Changes will be fairly small, with the main changes
being:
 - print is replaced by a print() function
 - / will become the float division operator
 - changes towards iterators (e.g. range() doesn't return a list)
 - string filetype changes
There are lots of other changes, but most of them include removing
already deprecated idioms. [1] has a list of Python 3k changes.
There's also the 2to3 conversion tool which allows you to run lots of
conversion automated.

> That asked, I've heard that 2.6 can be configured to warn when using
> code that will not run in 3.x. Is this correct?
Yes, 2.6 will support a "Py3k warnings mode". It should also have many
of 3k's features already implemented, allowing to run both side-by-side
or via __future__. PEP 3000 ([2]) has more info on this.

> How is this done? I'd like to do it on a per-file basis, so that I will
> only need to run one version of python on this machine.
Don't know. But if your only using it for some home-coding, you would
just once do the conversion and then update to 3k.

> I want my own apps to throw errors,
> but not other python apps on this system. Is there some error-level
> code that I can run?
Not sure what you mean by that. Are you refering to exception-handling?

I'd say it's not a bad time to learn Python. There will be some major
changes in 3k, but as long as you don't have to maintain 2.6 and 3.0 in
parallel, conversion should be easy enough.

Cheers,
thomas pani

[1] http://docs.python.org/dev/3.0/whatsnew/3.0.html
[2] http://www.python.org/dev/peps/pep-3000/


More information about the Tutor mailing list