Hacker News new | ask | show | jobs
by makapuf 1275 days ago
If your import statements are indented, they must be in control statements (try/except or conditional imports, I fail to see why you would put those in a loop) thus they will be difficult to reorder if you import another module (with different name or stdlib status) on import error.
1 comments

I'm not sure what you mean here, but package names can be indented without conditionals or tries, as in...

  from application.module.modules import (
      Model1, Model2, Model3, Model4, Model5, Model6
  )
iSort handles this fine if you're using spaces for indentation.
> I have no idea how to <pre> on HN

  Two or more leading spaces on each line.[1]
[1] https://news.ycombinator.com/formatdoc
Thank you, fixed it up.