Skip to content
Holly Becker edited this page Jan 11, 2016 · 3 revisions

Ideas

Discussion

For attributes directly corresponding to XML elements, use python style naming (rights_basis) or XML style (rightsBasis) ?

  • Python
    • consistent with python styling
    • consistent with anything that doesn’t directly map to elements
    • inconsistent with the actual XML, have to do mental mapping between the two
  • XML
    • easy to see relation between attribute and originating tag
    • mismatches with rest of python code

Access things via dict (foo[‘value’]) or by attribute (foo.value) ?

  • dict-style
    • use .get(value, None) to get default values if it may not exist
    • easier to give access to (probably using dict internally anyway, just use wrapper for __get__)
  • attribute
    • less typing
    • probably harder to populate (maybe use @property?)
Clone this wiki locally