Sorting imports with isort — Perfect Python

preview_player
Показать описание
Welcome to Perfect Python, the series where I show you how to take your code to the next level — perfection.

In this episode we'll be talking about sorting imports using "isort" (yes, it is stylised all lower-case). This may not seem like a big deal, but it's incredibly useful for those viewing your code, as it allows them to see exactly where everything is being imported from at a glance, and provides insight on what dependencies are being used, and what local files are being brought in.



If you enjoy my content, consider supporting me on Patreon (or hit the JOIN button below to become a member)!

If you need help with anything, feel free to join the Discord server:



If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.

#python #guide #devops
Рекомендации по теме
Комментарии
Автор

Just as a note to those who use VSCode: There is a separate pre-release extension in VSCode for Isort since this month, as they are in the process of extracting all the tools from the python extension into their own extensions for performance and other reasons.

Alkatar
Автор

Nice video. Which VSCode theme are you using?

rafaelc.
Автор

What's the advantage of sorting imports apart from tidiness? Why do we need improve the readability of imports?

kennethng
Автор

Who are all watching after implementing tox for building your modules

VTVT