A RetroSearch Logo

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

Search Query:

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

[Python-Dev] PEP 8 updates/clarifications

[Python-Dev] PEP 8 updates/clarifications [Python-Dev] PEP 8 updates/clarificationsJim Fulton jim at zope.com
Mon Dec 12 12:24:22 CET 2005
skip at pobox.com wrote:
>     Ian> Do not use accessor methods, like ``obj.getFoo()`` and
>     Ian> ``obj.setFoo(v)``, instead just expose a public attribute
>     Ian> (``obj.foo``).  If necessary you can use ``property`` to implement
>     Ian> the same functionality that accessor methods would give you.
> 
> Don't properties only work with new-style clsses?  If so, this should
> probably be noted.

Read properties work with old-style classes.  Write properties require
old-stype classes.  I'm always forgetting this for some reason.  Yes, it
should be noted.

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