2012/8/15 Doug Blank <firstname.lastname@example.org>
On Tue, Aug 14, 2012 at 7:42 AM, Doug Blank <email@example.com> wrote:
I looked into making the output always be the same type (considered
>> About implementation. I would expect it to be a dictionary of dictionaries,
>> and on lowest level strings or integer, but sometimes it is list, because it
>> has to be ordered.
>> Well, I don't like that "citation_list": CitationBase.to_struct(self) is a
>> list, but other to_structs are dicts (wrong doc of the method there by the
>> way). I think these objects better have no to_struct method, and you just
>> write the attribute you need.
>> to_struct being list is counterintuitive.
dicts, orderdicts, and namedtuples) but I think it is better to see
this analogous to Object.serialize(). Object.serialize() will give you
a variety of types depending on the Object (list, tuple, int, bool,
and even dict).
It would be handy to mark some of these items with additional
metadata. For example, marking a handle as such indicates that it is a
dependency. But I'll look into other ways to mark it...
But why do these Base objects require a to_struct? Just obtain the single attribute you require.
The fact that it is a list, indicates to me you don't need to_struct.