PEP 8: on member variables vs. attributes

Jonathan P. jbperez808 at yahoo.com
Sat Jan 18 04:39:30 CET 2003


> From PEP 8:
> 
> Designing for inheritance
> 
>       ...  In general, never make data
>       variables public unless you're implementing essentially a
>       record.  It's almost always preferrable to give a functional
>       interface to your class instead (and some Python 2.2
>       developments will make this much nicer)...

I get both your points.  I guess my precise question would
be:  Doesn't the recommendation to use properties (for
its syntactic sugar benefits) essentially deprecate the
suggestion to make a 'functional' interface to your class? 
Properties, after all, are identical in usage to attributes.  
I guess better clarifying language is needed in the PEP.




More information about the Python-list mailing list