[Bf-python] object.getDataName() - Implimented

Stephen Swaney sswaney at centurytel.net
Wed Feb 2 17:35:05 CET 2005


On Wed, Feb 02, 2005 at 01:56:36AM -0200, Willian Padovani Germano wrote:
> 
> I'm committing a quick test, adding an optional keyword arg to 
> object.getData():
> obj.getData(only_name = True) will return only the name, not the object 
> wrapper itself.  obj.getData() works as before, as well as: 0 or 1 or 
> True or False and only_name = True or 1 or False or 0, as expected.  For 
> readability, using .getData() to get obdata wrappers and 
> .getData(only_name = True) for the name string is better, of course.

I like this idea!  Very Pythonic.  Maintains the object-oriented style
And it doesn't clutter up the namespace.
 
> I'm not sure about "only_name" keyword, if anyone has a better 
> suggestion, feel free to comment.

Like maybe "just_the_name_and_not_all_that_other_crap" ?
Or maybe "name_only".  Somehow that sounds better to my ear.

> Anyway, just a test, tell me what you think.  We may also update the 
> .Get() module functions with something like this later, Stephen.  As you 
> say, at least for NMesh the economy makes it worthwhile.  Besides, 
> unlinked objs and obdata can't be found from Python unless we know 
> their  names.  

I agree.  This would be a nice enhancement for the .Get() methods.

-- 
Stephen Swaney			
sswaney at centurytel.net



More information about the Bf-python mailing list