| 208 | # gh-145492: defaultdict.__repr__ should not cause infinite recursion |
| 209 | # when the factory's __repr__ calls repr() on the defaultdict. |
| 210 | class ProblematicFactory: |
| 211 | def __call__(self): |
| 212 | return {} |
| 213 | def __repr__(self): |
| 214 | repr(dd) |
| 215 | return f"ProblematicFactory for {dd}" |
| 216 | |
| 217 | dd = defaultdict(ProblematicFactory()) |
| 218 | # Should not raise RecursionError |
no outgoing calls
searching dependent graphs…