A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-December/146914.html below:

[Python-Dev] List mutation in list_repr?

[Python-Dev] List mutation in list_repr? [Python-Dev] List mutation in list_repr?Patrick Westerhoff PatrickWesterhoff+python at gmail.com
Wed Dec 7 05:19:40 EST 2016
On Tue, Dec 6, 2016 at 5:32 PM, Random832 <random832 at fastmail.com> wrote:
> It *shouldn't*, but it can't be enforced. It's one of those things where
> if Python assumes all user code is sane (in this case, overridden
> __repr__ not messing with the list) it can bite in a way that could
> cause the interpreter to crash.

I guess you are right. That makes sense. I didn’t think about the
possibility that although the repr implementation is happening in
native code where the user objects have no access to, the list object
could still be referenced outside of the repr call.

Thanks a lot for the explanation and your example!

And also thank you Hrvoje Niksic!
More information about the Python-Dev mailing list

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