| Conditions | 4 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 48 | def dict_to_object(self, d): |
||
| 49 | if '__type__' not in d: |
||
| 50 | return d |
||
| 51 | |||
| 52 | type = d.pop('__type__') |
||
| 53 | if type == 'datetime': |
||
| 54 | return datetime(**d) |
||
| 55 | elif type == 'NodeId': |
||
| 56 | return ua.NodeId(**d) |
||
| 57 | else: |
||
| 58 | # decoder subclass can't handle this object type; put it back in the dict so super throws TypeError |
||
| 59 | d['__type__'] = type |
||
| 60 | return d |
||
| 61 |