(self)
| 22 | setattr(self, key, value) |
| 23 | |
| 24 | def __repr__(self): |
| 25 | if id(self) in _repr_stack: |
| 26 | return object.__repr__(self) |
| 27 | _repr_stack.add(id(self)) |
| 28 | try: |
| 29 | return class="st">"%s(%s)" % ( |
| 30 | (self.__class__.__name__), |
| 31 | class="st">", ".join( |
| 32 | [ |
| 33 | class="st">"%s=%r" % (key, getattr(self, key)) |
| 34 | for key in sorted(self.__dict__.keys()) |
| 35 | if not key.startswith(class="st">"_") |
| 36 | ] |
| 37 | ), |
| 38 | ) |
| 39 | finally: |
| 40 | _repr_stack.remove(id(self)) |
| 41 | |
| 42 | |
| 43 | _recursion_stack = set() |
nothing calls this directly
no test coverage detected