(obj)
| 1083 | |
| 1084 | |
| 1085 | def _try_iter(obj): |
| 1086 | if obj is None: |
| 1087 | return obj |
| 1088 | if _is_exception(obj): |
| 1089 | return obj |
| 1090 | if _callable(obj): |
| 1091 | return obj |
| 1092 | try: |
| 1093 | return iter(obj) |
| 1094 | except TypeError: |
| 1095 | # XXXX backwards compatibility |
| 1096 | # but this will blow up on first call - so maybe we should fail early? |
| 1097 | return obj |
| 1098 | |
| 1099 | |
| 1100 | class CallableMixin(Base): |
no test coverage detected