For internal usage in nbdime library. Minimal class providing attribute access to diff entiry keys. Tip: If performance dictates, we can easily replace this with a namedtuple during processing of diffs and convert to dicts before any json conversions.
| 17 | |
| 18 | |
| 19 | class DiffEntry(dict): |
| 20 | """For internal usage in nbdime library. |
| 21 | |
| 22 | Minimal class providing attribute access to diff entiry keys. |
| 23 | |
| 24 | Tip: If performance dictates, we can easily replace this |
| 25 | with a namedtuple during processing of diffs and convert |
| 26 | to dicts before any json conversions. |
| 27 | """ |
| 28 | def __getattr__(self, name): |
| 29 | if name.startswith("__") and name.endswith("__"): |
| 30 | return self.__getattribute__(name) |
| 31 | return self[name] |
| 32 | |
| 33 | def __setattr__(self, name, value): |
| 34 | self[name] = value |
| 35 | |
| 36 | |
| 37 | class DiffOp: |
no outgoing calls
no test coverage detected