You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
configparserclear() on a section or parser takes quadratic time #161108
SectionProxy and RawConfigParser inherit clear() from MutableMapping, which calls popitem() once per entry. Each popitem() call copies all remaining keys (SectionProxy.__iter__() builds the merged option list, RawConfigParser.popitem() calls sections()), so clearing a section or the parser takes quadratic time.
This takes several seconds for 20000 options and four times as long with twice as many; parser.clear() with many sections behaves the same way. parser.clear() dates from gh-61024.
Activity
gh-161108: Make configparser clear() linear time (GH-161109)
[3.14] gh-161108: Make configparser clear() linear time (GH-161109) (#…
[3.15] gh-161108: Make configparser clear() linear time (GH-161109) (#…