TinCanPython icon indicating copy to clipboard operation
TinCanPython copied to clipboard

Does it ever make sense to delete attributes?

Open chaimleib opened this issue 10 years ago • 3 comments

If not, should we remove the deleters, and make all attributes behave as 'required'?

-> If so, should we change the meaning of _props_req and _props?

chaimleib avatar Jun 27 '14 16:06 chaimleib

What does the word "delete" mean in this case? If it is more akin to 'unset' or setting to undefined/null equivalent then that is certainly valid. If it means this object does not have a particular attribute anymore then it doesn't.

brianjmiller avatar Jul 23 '14 13:07 brianjmiller

The second one. Trying to access a deleted attribute will result in an AttributeError

chaimleib avatar Jul 23 '14 14:07 chaimleib

Then :+1: to getting rid of deleters, don't think there is ever a case where an attribute should be removed. Presumably they would set to None if they need to "clear" a value which would be common. I don't think need to change _props and _props_req as the 'req' there is more akin to 'required' by the LRS for valid object (at least I think, feel free to correct if wrong).

Want to do the work?

brianjmiller avatar Jul 23 '14 14:07 brianjmiller