<- Back | Index | Forward ->

Daylight Properties

Daylight is migrating to a "property" based scheme very similar to Python object attributes.

Should PyDaylight classes do a property lookup if the attribute lookup fails? -- No.

Instead, make properties look like Python dictionaries.
  atom = Atom(12)
  atom.prop["color"] = "mauvish shade of pinkish russet"
  print atom.prop["color"]
  print atom.prop.keys()   # calls dt_propnames
  atom.prop["python list"] = [2, 3, 5, 8, 13, 21]
  print len(atom.prop["python list"])
The last two lines are implemented by serializing the Python data to a string in the "pickle" format.