A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-December/058689.html below:

[Python-Dev] On moving to new-style classes

[Python-Dev] On moving to new-style classesJim Fulton jim at zope.com
Tue Dec 13 16:45:13 CET 2005
skip at pobox.com wrote:
>     Jim> For debugging purposes, it's easy to add a property to allow
>     Jim> debugging of attribute assignment.
> 
> Assuming you use new-style classes, which I often don't.  The property/debug
> idea that you and Gustavo have both now mentioned makes them a bit more
> attractive.
 >
> Is there a new-style class HOW-TO somewhere?

See http://www.python.org/doc/newstyle.html

 > It would be useful to
> summarize the advantages for them.  I still have this thought stuck in my
> head (from where, I don't know, probably incorrect) that one of the main
> reasons for new-style classes was to get rid of __dict__.

No, the main benefit is to begin to resolve the class/type dichotomy.
Among other benefits, this allows you to subclass types written in C.

Of course, there are other benefits, most notably descriptors, which make
properties, among other things, possible.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4