(obj)
| 26 | |
| 27 | |
| 28 | def _iter_vars(obj): |
| 29 | attrs = [] |
| 30 | |
| 31 | if hasattr(obj, "__dict__"): |
| 32 | attrs.append(iteritems(vars(obj))) |
| 33 | |
| 34 | if hasattr(obj, "_fields"): |
| 35 | attrs.append(iteritems(obj._fields)) |
| 36 | |
| 37 | return itertools.chain.from_iterable(attrs) |
| 38 | |
| 39 | |
| 40 | def iterwalk(obj): |