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
Post a Comment