[Python-Dev] PEP 8 addition: Preferred property style?

Raymond Hettinger python at rcn.com
Thu Jan 22 18:17:51 EST 2004


[Gerrit]
> I think there is a problem with the current way of defining
properties.
> A property commonly exists of several parts. These parts form one
> object. But the parts are not grouped by indentation. In my opinion,
> readability would be enhanced if they would. One way to do this is
> adding syntax - discussed about a year ago with no conclusion. Another
> way is to use a class with a metaclass - not clean, because you aren't
> creating a class after all. I thought this would be a good concession,
> but it has similar disadvantages.
> 
> Do you agree that there is a a problem here?

I don't agree.

The get/set/del functions can be defined anywhere (even outside the
class definition).  It is the line where property() is called that
everything comes together and that works out fine, both in theory
and practice.

not-everything-needs-special-syntax-ly yours,


Raymond Hettinger




More information about the Python-Dev mailing list