redbaron icon indicating copy to clipboard operation
redbaron copied to clipboard

Improve and simplify the CommaProxyList algorithm.

Open duncf opened this issue 8 years ago • 4 comments

With this change CommaProxyList better handles and preserves non-standard (and even inconsistent) indentation, rather than assuming indented lists are indented by four spaces (fixes #100). It also is significantly faster in very large files by avoiding use of ".indentation", which can require iterating over every element in the file. End-of-list comments are preserved at the end of the list, and inline comments are also preserved.

duncf avatar Jul 22 '17 04:07 duncf

I have the same issue, could this please be merged?

janlugt avatar Jan 04 '18 00:01 janlugt

@Psycojoker, could you take a look at this?

janlugt avatar May 16 '18 18:05 janlugt

@Psycojoker, could you reconsider merging this and https://github.com/PyCQA/redbaron/pull/145? It dramatically improves the performance of the CommaProxyList algorithm.

janlugt avatar Dec 09 '19 19:12 janlugt

+1 The CommaList exception got me here.

hectorv avatar Apr 30 '20 06:04 hectorv