Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Almost every tech company will have some sort of commit hook using isort to force correct import ordering at the top of the file.


Ha, if only! I've been the one to introduce this at the last three jobs I've had, two of which had hundreds of engineers and plenty of python code before I got there.

"Best practices" are incredibly unevenly distributed, and I suspect this is only more true for data/ML-heavy python code.


New (v5) isort doesn't move imports to the top of the file anymore, at least not by default. There is a flag to retain the old behavior, but even then I don't think it will move imports from, say, inside a function body to the top of the module.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: