[Bf-python] API style clarification

Stephen Swaney sswaney at centurytel.net
Sun Dec 24 22:26:38 CET 2006


On Sun, Dec 24, 2006 at 08:22:29AM -0800, Ken Hughes wrote:
> Campbell Barton wrote:
> >campbellbarton (Campbell Barton) 2006/12/24 04:25:53 CET
> >
> >  Modified files:
> >    blender/source/blender/python/api2_2x/doc Camera.py 
> >  
> >  Log:
> >  added camera.dofDist to the python camera module
> 
> Was looking over this commit and say Cam added a .dofDist attribute and 
> getDofDist()/setDofDist().  What's the "policy" on attributes vs 
> methods?  I've only been adding methods when they aren't simple enough 
> to be getseters (i.e, multiple parameters, etc).
> 
> I'm not trying to critisize Cam's commit; I was thinking maybe I've been 
> wrong by not commiting get()/set() methods when I should be.
> 
> Ken

No, you are correct, Ken.  We want to migrate away from methods
for getting and assigning to attributes.  As you point out,
we will still need methods for doing fancey things, but tp_getset
tables are the general rule.

-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list