The "Auto Import" quick fix puts its imports before the module docstring, but in order to be valid, the docstring must be the first thing in the module, before everything including imports.
It has to do with the number of lines preceding the docstring. The magic number seems to be 3: if you have 3 lines preceding the start of the docstring in an otherwise empty file, the quick fix works as expected. But, if you have *4* lines, it puts the import at the top of the file.
This tends to affect projects with large copyright-statement mastheads in comments which go before the docstring.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Strange, I've tested it here and it seems to work for me. Can you attache a sample code where this happens?
It has to do with the number of lines preceding the docstring. The magic number seems to be 3: if you have 3 lines preceding the start of the docstring in an otherwise empty file, the quick fix works as expected. But, if you have *4* lines, it puts the import at the top of the file.
This tends to affect projects with large copyright-statement mastheads in comments which go before the docstring.