[Bf-python] Getters and setters in object selection

Benjamin Humpherys benjamin.humpherys at gmail.com
Mon Nov 5 18:37:07 CET 2018


I saw on the recent changes page on the wiki that the object selection API (https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API#Object_Selection_and_Hiding <https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API#Object_Selection_and_Hiding>) has changed from a simple `obj.select` property to `select_get()` and `select_set(’SELECT’)`. I strongly urge this decision to be reconsidered because it is not idiomatic Python to use getter and setter functions, let alone setting a boolean property with a string argument!

Instead of getters and setters please consider making `select` a @property, or utilizing `PyGetSetDef`(https://docs.python.org/3/c-api/structures.html#c.PyGetSetDef <https://docs.python.org/3/c-api/structures.html#c.PyGetSetDef>) to hide any new getter/setter logic instead of putting it in the user-facing API.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20181105/7a7d329b/attachment.html>


More information about the Bf-python mailing list