[Python-Dev] PEP 8 updates/clarifications
Guido van Rossum
guido at python.org
Mon Dec 12 05:15:13 CET 2005
On 12/11/05, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Josiah Carlson wrote:
> > 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.
> >
> > In the future, aren't all classes going to become new-style? Was it
> > going to wait until Py3k, or sometime sooner?
>
> Going the Java route (no implicit base class) would be an interim step along
> that road (i.e., a release or two where there is no default __metaclass__
> fallback).
>
> Any old code could be fixed by putting "from types import ClassType as
> __metaclass__" at the top of the affected modules.
I'm not sure what you are proposing and I'm not sure what problem you
are trying to solve.
The plan for new-style vs. classic classes is simple and doesn't need
to change (IMO): until Py3k, the status quo will remain; in Py3k,
there is only new-style (except if you use a custom metaclass).
(That said, I'm all for exceptions becoming new-style in 2.5.)
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list