hhatto/autopep8 — pull request #114 by gwelymernans (2014-01-13 02:44:37+00:00)
Title: Experiment Rewrite

I rewrote the experimental code that "reflows" the incoming tokens. This is much nicer and easier to understand code. It takes the approach of treating everything --- including newlines, spaces, and indentations --- as its own object with its own size. This allows for greater control over the final format, because deciding that a newline should be placed in a different location is not a simple matter of moving some objects around instead of regenerating the string. (N.B. that part isn't written yet, but it should be a fairly straight-forward extension.)

Caveat: I only made sure that the ```--experimental``` flag can go through all of the examples that the previous implementation could. I.e., there are almost certainly bugs still to be found and squashed. But I wanted to send this in because I don't think the code already in the tree should last much longer.