any ways to judge whether an object is initilized or not in a class

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Mar 20 00:02:41 EDT 2007


"Steven D'Aprano" <steve at REMOVE.THIS.cybersource.com.au> writes:

> On Mon, 19 Mar 2007 19:48:37 +1100, Ben Finney wrote:
>
> > It's also best to inherit every class from another class, leading
> > to a single hierarchy for all classes and types. 'object' is the
> > one to choose if you don't want the behaviour of any other class.
>
> What's wrong with old-style classes?

    <URL:http://wiki.python.org/moin/NewClassVsClassicClass>

The main ones for me are:

  - super() doesn't work.

  - property() doesn't work as expected.

  - They will disappear in a future version of Python, and the docs
    recommend them for backward compatibility with existing code. This
    is reason enough to avoid writing classic classes in any new code.

    More importantly, it's a reason to educate all new programmers in
    using new-style classes and inheritance.

-- 
 \      "I don't know half of you half as well as I should like, and I |
  `\      like less than half of you half as well as you deserve."  -- |
_o__)                                                    Bilbo Baggins |
Ben Finney




More information about the Python-list mailing list