> and I also don’t see any clue in the source as to when [list mutation] > would actually happen. Since inside the loop, the list object `v` is > never accessed other than passing `v->ob_item[i]` to the recursive > repr call, there shouldn’t be any mutation on the list object itself. The individual object can have a reference to the list and (in extreme cases) do with it what it pleases: class Evil: def __init__(self, l): self.l = l def __repr__(self): del l[:] return "evil" l = [] l.append(Evil(l)) l.append(Evil(l)) print(l) That is not something normal Python code does, but it shouldn't be allowed to crash the interpreter, either.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4