[Bf-python] short term goals

Ken Hughes khughes at pacific.edu
Tue Jul 19 08:27:18 CEST 2005


Stephen Swaney wrote:
> For the next phase of the Bpy Cleanup we would like to do two things:
> 
> 2) start to migrate our attribute handling code to use the tp_getset
> interface.
> 
> Right now our attribute access is done thru the tp_getattr and
> tp_setattr slots in our PyTypeObjects where we lookup string names for
> attributes and call the appropriate method.  Since the programmatic
> interface here is similar to method calls we have duplicated all
> our attribute access with  x.getStuff() / x.setStuff() methods
> 
> The difference between tp_getset style and the x.setStuff() is the way
> arguments are passed and the return types.  For tp_getset, the
> argument is a PyObject pointer.  For the setStuff() style,
> that same pyObject argument is wrapped in a tuple.
> 
> Since tp_getset is the wave of the future, what we would like to do
> here is have the setStuff() methods parse out the pyobject and then
> call the appropriate method from the PyGetSetDef table ( the one for
> the tp_getset slot ).  Both getStuff() and setStuff() wrappers will
> also need to fix up the return type.
> 
> This is mostly grunt work, but happily we have a willing victim, errr,
> I mean volunteer.  Thanks, Ken!
> 
> Right now, for backward compatibility, we will keep the getStuff() 
> setStuff() methods unchanged.

So the naming con



More information about the Bf-python mailing list