[Tutor] changes in Python 2.2

alan.gauld@bt.com alan.gauld@bt.com
Wed, 26 Jun 2002 11:21:34 +0100


> Trying to learn Python on top of Java and a few other 
> languages has been to say the least a breath of fresh 
> whilespace

I know the feeling.

> But now having read A.M Kuchling's excellent "What's New in 
> Python 2.2", ....new classes, iterators, generators....
> Python is looking to me more and more like --well--,  another language.

That was my initial feeling on 2.2 too.

Python might be heading in a dangerous direction of trying to be 
too universal. I have an uneasy feeling having seen C++ go down 
the same route and become so infested with dark corners that it 
has become almost unusable for anyone but a guru.

The good news is that so far Pythons changes are optional and can 
be safely ignored if you don't need them (except that the bloat 
inevitably slows the interpreter down and makes it bigger!).

> My question is as a newbie how concerned should I be about 
> what seem to me to be major additions/ complexity to the language?  

As a newbie just ignore them.
When you suddenly find a need for one or more of them thats 
when to read up the docs and start playing.
For me the new classes are interesting in an acedemic sense.
Generators I might use occasionally. Iterators I don't like in 
principle although they are a popular fashion in languages 
these days(C++, Java, Ruby etc)

> evolutionary changes that have been brewing and finally risen 
> to the top?

They are pretty revolutionary IMHO representing a fairly 
fundamental change in approach. But they are being implemented 
in an evolutionary way so you don't really need to worry 
about them for now.

> across an article at www.informIT.com/deitel on Properties. 

Properties are one of the things I like - as are static methods.

> problem might be just I don't know how much to try to absorb  
> as a newbie to programming; 

All you need to start are sequences, loopps and branches, I/O 
and some data types/operations.

Once you have those sorted you can program in any language, 
learn the more advanced features as you need them....

> Now I certainly won't be implementing any 
> Python subclasses in C for a long time to come, 
> but I sure want to use the new iterators on 
> dictionaries and such!

You've just answered your own question.
Investigate iterators ignore the rest for now.
Read about them so you know they exist by all means but 
don't lose sleep over them...

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld