class - Python - do I need to learn about old style classes? -


i learning python 2.6.5 , found out old style classes , new style classes.

i understand these classes still existing backward compatibility , removed in python 3.

so question this: as newcomer language, need learn classic classes?

p.s. learning python 2 because python 3 still not supported in frameworks , want learn frameworks too. plan move python 3 when frameworks catch up, until then, need worry old style classes?

no. don't bother. inherit classes object (or classes inherit object) , go. when transition python 3 can forget bit of syntax.

there's no advantage using or learning old-style classes @ point.

so make sure of class declarations this:

class foo(object):     ... 

(or inherit other object does inherit object), , pretend way has been!


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -