I like how rdfMultiple raises an AttributeError if I try to pass in a
non-list.
Could we get rdfSingle to do something similar if we try to pass in a
list or tuple? That doesn't cover all incorrect types, but would cover
the most common mistakes.
Something like:
+++ descriptors.py (working copy)
@@ -145,6 +145,10 @@
def __set__(self, obj, value):
log.debug("SET with descriptor value %s of type %s"%
(value,type(value)))
#setattr(obj,
self.name, value) #this recurses indefinatly
+
+ if isinstance(value, list) or isinstance(value, tuple):
+ raise AttributeError("to set an rdfSingle you must pass
in a single value")
+