From PEP 8:
- Imports should usually be on separate lines, e.g.:
Yes: import os
import sys
No: import sys, os
it's okay to say this though:
from subprocess import Popen, PIPE
I thought comma separated style is simpler, shorter, easier to read and write, until I read PEP8. Does it have any disadvantage? PEP 8 didn't give any explaination about that.
So my question is, why is that bad?
One reason might be that it's easier for source control systems to identify differences on a per-line basis than it is to do that within source lines.
Like a lot of PEP 8, it's a matter of preference. Consistency is more important than which option you end up choosing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With