ankit said:
Hello,
Please put some light on, What are new style classes and classic style
classes in python. The basic differences in them. And How can I decide
to choose one.
"Classic" (old-style) classes are ones with no ancestor classes that are
built-in types; "new-style" classes are one with ancestor classes that
are built-ins (including the built-in type 'object', which exists for
the sole purpose of making classes new-style). New-style classes have a
clearer and better organized approach to attribute access, and allow you
to use such powerful features as 'property' to full effect.
Old-style classes exist only for backwards compatibility. The only good
reason to decide to make a class old-style is when you're making an
*exception* class, specifically: up to Python 2.4, exception classes
must be old-style.
Alex