(self)
| 13 | repr_running = set() |
| 14 | |
| 15 | def wrapper(self): |
| 16 | key = id(self), get_ident() |
| 17 | if key in repr_running: |
| 18 | return fillvalue |
| 19 | repr_running.add(key) |
| 20 | try: |
| 21 | result = user_function(self) |
| 22 | finally: |
| 23 | repr_running.discard(key) |
| 24 | return result |
| 25 | |
| 26 | # Can't use functools.wraps() here because of bootstrap issues |
| 27 | wrapper.__module__ = getattr(user_function, '__module__') |