(x)
| 66 | return x == y |
| 67 | |
| 68 | def deepcopy(x): |
| 69 | if hasattr(x, 'fields'): |
| 70 | vals = {} |
| 71 | for f in x.fields.keys(): |
| 72 | vals[f] = deepcopy(getattr(x, f)) |
| 73 | return x.__class__(**vals) |
| 74 | elif isinstance(x, list): |
| 75 | return [deepcopy(y) for y in x] |
| 76 | else: |
| 77 | return x |
| 78 | |
| 79 | def to_dict(x): |
| 80 | if hasattr(x, 'fields'): |
no outgoing calls