> Do not use accessor methods, like ``obj.getFoo()`` and
> ``obj.setFoo(v)``, instead just expose a public attribute
(``obj.foo``).

This advice is, of course, not appropriate for all users (properties are
not typically in a Python beginner's skill set) or all use cases.  It is
closer to one person's view of the One-Right-Way(tm).  Opinions on
programming best practices vary widely, evolve over time, and may be
context dependent.



> > While, on some level, private variables seem attractive, I think
that
> > experience (for everyone I know) has shown them to be an attractive
> > nuisance.  I recommend discouraging them.
> 
> I really really hate double underscores

FWIW, I think we have no business dictating to others how they should
name their variables.  This is doubly true for a convention that has a
long history and built-in language support.

My preference is to leave PEP 8 for the minimum practices necessary for
one programmer to be able to read and maintain another programmer's
code.



Raymond

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to