0

I came across certain source code that mentioned import ...utils. What does this mean?

The code was in Python3.

Navid Khan
  • 979
  • 11
  • 24
  • 1
    Means you are importing from the *grandparent* directory, aka the parent's parent directory. – kpaul Mar 25 '19 at 03:31
  • @kpaul: Relative imports aren't a directory traversal mechanism. Thinking about them in terms of directory traversal produces wrong results for cases like namespace packages, or trying to navigate past the root of the package structure. – user2357112 Mar 25 '19 at 03:54
  • @Selcuk that duplicate question doesn't actually have an answer that mentions triple dots – craq Aug 01 '19 at 04:22
  • 1
    @craq Please read the answer carefully: "[...] Two dots means up one package level. **Three dots is up two levels, etc.**" – Selcuk Aug 01 '19 at 04:28
  • right, sorry. That was buried in a wall of text. I missed that when skimming it, and searching for "..." and "ellipse" came up blank – craq Aug 01 '19 at 04:33

0 Answers0