The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.python
From: Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info>
Date: 25 Sep 2012 16:20:44 GMT
Local: Tues, Sep 25 2012 12:20 pm
Subject: Re: new-style class or old-style class?
On Tue, 25 Sep 2012 07:44:04 -0700, Jayden wrote:
New-style classes.
> 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?
Yes.
Always use new-style classes, unless you have some specific reason for Advantages of new-style classes:
1) They are the future. In Python 3, all classes are "new-style" and 2) Multiple inheritance works correctly. Multiple inheritance for classic 3) New-style classes support awesome features like super(), properties, The main disadvantage is that automatic delegation is a pain to do -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||