Daira-Emma Hopwood

Results 724 comments of Daira-Emma Hopwood

A test is on the https://github.com/python-modernize/python-modernize/commits/19-import-after-use branch.

This seems relevant: http://bugs.python.org/issue14282

Yes, I think adding imports after existing ones is wrong in general. Imports added by `python-modernize` should go: - after existing `__future__` imports, if any - otherwise, after the module...

According to `grep -Rn --include='*.py' touch_import /usr/lib/python2.7/lib2to3/fixes` (on Python 2.7.5ish), the fixers in `lib2to3` itself that use `touch_import` are: fix_intern, fix_callable, fix_operator and fix_reduce. Of those, only fix_operator and fix_reduce...

Huh, I can no longer reproduce this using the tests that reproduced it before (which are now on master). Bumping this out of the 0.4 release.

Selecting fixers by short name is #27. If the reporter confirms that was the problem, we can close this (or perhaps make this ticket about improving the error reporting).

This isn't correct as-is, but I like the basic approach. I will work on it tomorrow.

That sounds like a good idea. As a workaround for lack of this feature, you can use `-z` in bash (http://stackoverflow.com/a/12137504/393146) to check that the output of python-modernize without the...

We could wrap all of the fixers we add, including the ones from lib2to3.

The implementation is different depending on whether python-modernize is running on Python 2 or 3: https://github.com/python/cpython/blob/master/Lib/lib2to3/refactor.py#L113 . On Python 2 at least, setting `os.linesep` to `"\n"` will make it use...