[SAGA-RG] SAGA attributes as Python dictionaries?

Hartmut Kaiser hkaiser at cct.lsu.edu
Thu Nov 5 07:15:54 CST 2009


> > > > It is certainly doable from the technical point of view. My
> question
> > > > is what would be the advantages of having a dict-like interface?
> > > Would
> > > > that be in this form then:
> > >
> > > If I rember the discussion from Banff correctly, the proposal was
> > > more like
> > >
> > >   jobDescription.attributes["Executable"] = "/bin/hostname"
> >
> > Why not:
> >
> >    jobDescription["Executable"] = "/bin/hostname"
> 
> Yes, I'd also prefer this. Much shorter, and it resembles that a job
> description IS-A Attributes.

Well, I stand corrected, it _is_ possible by overloading
__getattr__/__setattr__.

Regards Hartmut

-------------------
Meet me at BoostCon
http://boostcon.com




More information about the saga-rg mailing list