Replies: 2 comments 4 replies
-
So, other than the textual representation, how are (Although, there's a tangential discussion that we should have about when to use My desire is that it should be easy, either as a coder or a reviewer, to know where a given import should go. If there is a question about whether to add one, it should be trivial to locate the spot in the code to see if it is already there. I'd rather not have to consult some external source to determine which block it goes in (i.e., I can easily recognize project imports, but I can't really tell standard library ones from 3rd party ones, given the ubiquity of 3rd party packages). There should be a unique location for each package so that I know where to look to see if the package has already been imported so that I can avoid adding redundant imports or so that I can find existing I'm concerned that having as many as six blocks doesn't support that desire. And, given that each import is supposed to be self-contained, I'm having trouble figuring out why we need more than one block. (Why should project imports be segregated from external imports?...This isn't like C |
Beta Was this translation helpful? Give feedback.
-
While this discussion happened a long time ago, we have since started use |
Beta Was this translation helpful? Give feedback.
-
Below is a current example (at least it is mostly adhered to ...) method of handling the ordering of imports to satisfy PEP8 while making it easy to sort the imports alphabetically without doing it manually.
We know which imports are not from the standard library because they exist in our
*-requirements.txt
files.Beta Was this translation helpful? Give feedback.
All reactions