STINNER Victor <vstin...@redhat.com> added the comment: Should we shrink the list of the length hint was way too big? For example, if the length hint was 100 but the final list of only 10. Should we shrink in that case?
I'm asking because it seems like Pablo's PR doesn't shrink the list in that case. I wasn't sure so I checked, del shrinks the list if needed: >>> x=list(range(1000)) >>> import sys >>> sys.getsizeof(x) 9112 >>> del x[1:] >>> sys.getsizeof(x) 96 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33234> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com