[Tutor] 2 vs 3

Alan Gauld alan.gauld at btinternet.com
Mon Sep 7 11:16:16 CEST 2015


On 07/09/15 02:15, Grady Martin wrote:
> On 2015年09月05日 23時33分, Alan Gauld wrote:
>> Once you get used to it - and it is a big jump, don't
>> underestimate the learning time - v3 is superior.
>
> This is the first I've heard someone describe the learning curve from 2
> to 3 in anything but negligible terms.  What makes the jump big?

Yes, that's what I thought too. Then I tried it.
It's nothing huge, but thee are a lot of small changes
that continually catch you out.

Modules have been moved into packages
Module names have changed.
Functions have been moved to new modules.
Function return types have changes
Exception handling has changed
Error types have changed
Class heirarchies have changed (especially the io hierarchy)
Data types have changed
metaclasses have changed
Strings have changed to Unicode and bytes

And of course if you are really moving to the v3 way of
doing things you should move to using the new string
formatting style.

I found it took me a couple of months before I stopped
having to jump into the docs and use help() even where I
thought I knew what I was doing.

Don't get me wrong, its still a worthwhile thing to do.
But don't be fooled by the hype, it is not a trivial change.
Your coding speed will slow down for a while till you
get used to it.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list