CONSTRUCT - New/Old Style Classes, build-in/extension types

Ilias Lazaridis ilias at lazaridis.com
Fri Sep 22 14:41:01 EDT 2006


Paul Boddie wrote:
> Ilias Lazaridis wrote:
... (helpful comments)

> > Have those old style classes any benefits?
>
> That you don't have to write the bizarre conceptual accident that is
> "(object)" when declaring a "top-level" class?

This was most possibly done for back-compatibility reasons.

Although introducing a change like this:

def MyOldClass(oldstyle)
def MyNewClass()

an giving lazy developers the search&replace patterns to migrate the
code would have been of benefit.

Possibly something for Python 2.6.

> Paul
>
> [1] http://www.python.org/doc/newstyle.html
> [2] http://www.python.org/doc/newstyle/

this page points to nice documentation (which I would place in top of
the list!!!):

http://www.cafepy.com/article/python_types_and_objects/ch03.html#id833463

-

"Guido's essay on new-style classes and should be your starting point."

This article should _not_ be suggested as a starting point.

.

--
http://lazaridis.com




More information about the Python-list mailing list