In article <2e8a9e88-9e7e-43f7-a070-ea9054e62...@googlegroups.com>,
 Jayden <jayden.s...@gmail.com> wrote:

> In learning Python, I found there are two types of classes? Which one are 
> widely used in new Python code? Is the new-style much better than old-style? 
> Thanks!!

If you're just learning Python 2.x, you might as well use new-style 
classes, since that's what all classes are in 3.x.

On the other hand, if you're just learning, it probably doesn't matter 
which kind you use.  Until you get into some pretty sophisticated stuff, 
you won't notice any difference between the two.

On the third hand, all it takes to create a new-style class is to have 
it inherit from object.  It's no big deal to write

>>> class Foo(object):

instead of just

>>> class Foo:

so you might as well use new-style classes :-)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to