Closed larsbutler closed 9 years ago
Hmm, Swift uses commas, the import style was stolen from there. I have no strong opinion though, but would like to hear somebody who did a lot of python, regarding this one.
I don't think I've seen an "import one symbol per line" style in the wild before, probably because people prefer importing the entire module when they find that they need more than one or two symbols from it.
Infact, the style guides I know all recommend importing modules instead of classes/functions. That simplifies the import statements a lot.
I simplifies import statements but complicates the code. You need to use module.func
instead of func
which is too long in the current situation of descriptive module and function names.
I'm not trying to alter the import conventions drastically. All this does is split multi-item imports to separate lines. That's it. For me, this is a lot easier to read and edit.
Hmm, Swift uses commas, the import style was stolen from there.
Yeah, and they're also breaking their own style guidelines by doing that. =)
It's an Openstack style guide. I consider Openstack code a horrible mess, compared to Swift code. So... I suppose we do not need to drag it too much, I have no objection to reorganizing imports this way.
Instead of using commas and backslashes for line continuation, having just one import per line improves readability.
It's also easier to edit imports this way; you can just add or remove lines. When changes like this are made, the diffs are more readable as well.