What is a code repository sub-package imports?

41 Views Asked by At

Looking at the Google Python Style Guide under 3.13 it says order of imports should be:

  1. Python Future Imports
  2. Python Standard imports
  3. Third Party module or package import
  4. Code repository sub-package imports

What exactly is Code repository sub-package imports ? If there is a library written by another team in the company is that Third Party or is it Code Repository?

1

There are 1 best solutions below

0
DeepSpace On BEST ANSWER

"Code repository sub-package imports" means a package that lives in the projects' directory.

If you have main.py and utils.py, you will do from utils import magic_algorithm last.

So, following that logic the entire thing might look like

from __future__ import braces       # future import
import re                           # python built-in import
from requests import Session        # third-party import
from utils import magic_algorithm   # code repository import