Thanks, I already looked at the source I was talking about confirming whether or not the existing
rehash!
would already work for the purpose of shrinking the Dict
. The relevant parts of the code (both of rehash!
as well as sizehint!
) hasn’t changed in the last 9 years and the todo
comment is still there, so I’d rather err on the side of caution and say jeff had a failure mode in mind when writing that code. Exhaustively checking all possible usages of dict shrinking isn’t feasible though…