[Bf-python] Const dict arguments

Ken Hughes khughes at pacific.edu
Wed Jul 20 04:40:36 CEST 2005


Stephen Swaney wrote:
> On Tue, Jul 19, 2005 at 02:43:15PM -0700, Ken Hughes wrote:
> 
> 
>>I agree with the const dicts, but I foresee a problem with backward 
>>compatibility for getters.  We can make x.setStuff() accept the old
>>and new argument types, but what type should x.getStuff() return
>>(same applies to "val = x.stuff")?  Should we leave well enough alone?
>>Should there be an attribute x.paramType which the user can set to
>>use const dicts instead?
> 
> For now, we will leave the x.getStuff() interface alone and focus on
> the tp_getset methods.  The x.getStuff() code will be our legacy API.
> Over time, this will become deprecated and the direct attribute access
> will be our preferred interface.  This will probably mean some
> duplicated code, but we can live with that.
> 
> Our users have a lot of time and energy invested in scripts.  Since
> the users are the whole point of this bpy exercise, we need to try to
> cause them as little pain as possible while still moving bpy forward.

Ok, so should the tp_getset exactly duplicate x.getStuff() methods which 
do not use const dicts, or should they only use const dicts?  In other 
words, we're implementing new code but should that wrap the older code 
which is using strings?

Ken



More information about the Bf-python mailing list