[Python-Dev] PEP 8 updates/clarifications (original) (raw)
Jim Fulton jim at zope.com
Tue Dec 13 13:16:44 CET 2005
- Previous message: [Python-Dev] PEP 8 updates/clarifications
- Next message: [Python-Dev] PEP 8 updates/clarifications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Barry Warsaw wrote:
On Sun, 2005-12-11 at 16:30 -0600, Ian Bicking wrote:
Potentially it could be added that the whole issue can often be avoided when an object's methods perform actions instead of returning attributes of the object. It's a long topic; maybe it could even just be a link, if someone knows of a good discussion along those lines. I'm sure there's some terminology here that I'm forgetting that describes the design pattern. There's also a point when the style guide becomes an API design guide, and I don't know how far it should go in that direction. I'm not exactly sure if this is what you're getting at, but one thing that bothers me is using data attributes to trigger actions. Maybe this gets into the "no side-effects" rule for data attributes, but attributes that cause an object to perform some action should always be explicit methods.
Exactly. That's why I suggested the PEP start with the trivial case, which, BTW is extremely common. Let judgement guide when something is no-longer trivial.
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
- Previous message: [Python-Dev] PEP 8 updates/clarifications
- Next message: [Python-Dev] PEP 8 updates/clarifications
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]