[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [master 5/6] iutil: execWithCallback() and execWithPulseProgress() return an object.



On 05/20/2010 10:58 PM, Brian C. Lane wrote:

I would probably just use a dict for something like this. To me classes
are for data structures and the methods that act on them, not just an
easy container for data -- that's what dicts are for. But that is likely
a personal preference :)


I am going to use objects, simply because accessing object.parameter looks (to me) more aesthetic than object["parameter"]. Plus I know returning an object here will always be sufficient whatever we decide to do with it in the future. The only thing a dictionary could offer over an object is that it's easier to iterate over its keys/values or test for their presence. But in this case we know all the 'keys' in advance.

Ales


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]