🕷️ Crawler Inspector

URL Lookup

Direct Parameter Lookup

Raw Queries and Responses

1. Shard Calculation

Query:
Response:
Calculated Shard: 179 (from laksa035)

2. Crawled Status Check

Query:
Response:

3. Robots.txt Check

Query:
Response:

4. Spam/Ban Check

Query:
Response:

5. Seen Status Check

ℹ️ Skipped - page is already crawled

đź“„
INDEXABLE
âś…
CRAWLED
5 days ago
🤖
ROBOTS ALLOWED

Page Info Filters

FilterStatusConditionDetails
HTTP statusPASSdownload_http_code = 200HTTP 200
Age cutoffPASSdownload_stamp > now() - 6 MONTH0.2 months ago
History dropPASSisNull(history_drop_reason)No drop reason
Spam/banPASSfh_dont_index != 1 AND ml_spam_score = 0ml_spam_score=0
CanonicalPASSmeta_canonical IS NULL OR = '' OR = src_unparsedNot set

Page Details

PropertyValue
URLhttps://philipmolloy.com/import.html
Last Crawled2026-04-05 09:35:23 (5 days ago)
First Indexed2019-04-09 15:14:10 (7 years ago)
HTTP Status Code200
Meta TitleAbsolute imports in __main__
Meta Descriptionnull
Meta Canonicalnull
Boilerpipe Text
I began to brush the dust off an old Python project by running the 2to3 , a Python program that can automate code translation from Python 2 to 3. The first suggestion was to replace the import statement in a __main__ file as follows: -from reference.wiktionary import Wiktionary +from .reference.wiktionary import Wiktionary This change was based on a fixer that “detects sibling imports and converts them to relative imports” (see Python documentation ). An explanation for this fixer can be found in the Intra-package References article, which states, “Note that relative imports are based on the name of the current module. Since the name of the main module is always”__main__“, modules intended for use as the main module of a Python application must always use absolute imports.” Absolute imports are explained by PEP 328 , which states, “In Python 2.4 and earlier, if you’re reading a module located inside a package, it is not clear whether import foo refers to a top-level module or to another module inside the package. … foo will always be a module or package reachable from sys.path. This is called an absolute import.” See also Nightmare with relative imports, how does pep 366 work? Using modules in main.py
Markdown
[Contents](https://philipmolloy.com/) May 14, 2013 # Absolute imports in \_\_main\_\_ I began to brush the dust off an old Python project by running the `2to3`, a Python program that can automate code translation from Python 2 to 3. The first suggestion was to replace the import statement in a \_\_main\_\_ file as follows: ``` -from reference.wiktionary import Wiktionary +from .reference.wiktionary import Wiktionary ``` This change was based on a fixer that “detects sibling imports and converts them to relative imports” (see [Python documentation](https://docs.python.org/2/library/2to3.html#2to3fixer-import)). An explanation for this fixer can be found in the [Intra-package References](http://docs.pytho.org/3.3/tutorial/modules.html#intra-package-references) article, which states, “Note that relative imports are based on the name of the current module. Since the name of the main module is always”\_\_main\_\_“, modules intended for use as the main module of a Python application must always use absolute imports.” Absolute imports are explained by [PEP 328](https://www.python.org/dev/peps/pep-0328/#rationale-for-absolute-imports), which states, “In Python 2.4 and earlier, if you’re reading a module located inside a package, it is not clear whether import foo refers to a top-level module or to another module inside the package. … foo will always be a module or package reachable from sys.path. This is called an absolute import.” ## See also - [Nightmare with relative imports, how does pep 366 work?](http://stackoverflow.com/questions/2943847) - [Using modules in main.py](http://stackoverflow.com/questions/3411293/using-modules-own-objects-in-main-py) © 2011-2025 Philip Molloy This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Readable Markdown
I began to brush the dust off an old Python project by running the `2to3`, a Python program that can automate code translation from Python 2 to 3. The first suggestion was to replace the import statement in a \_\_main\_\_ file as follows: ``` -from reference.wiktionary import Wiktionary +from .reference.wiktionary import Wiktionary ``` This change was based on a fixer that “detects sibling imports and converts them to relative imports” (see [Python documentation](https://docs.python.org/2/library/2to3.html#2to3fixer-import)). An explanation for this fixer can be found in the [Intra-package References](http://docs.pytho.org/3.3/tutorial/modules.html#intra-package-references) article, which states, “Note that relative imports are based on the name of the current module. Since the name of the main module is always”\_\_main\_\_“, modules intended for use as the main module of a Python application must always use absolute imports.” Absolute imports are explained by [PEP 328](https://www.python.org/dev/peps/pep-0328/#rationale-for-absolute-imports), which states, “In Python 2.4 and earlier, if you’re reading a module located inside a package, it is not clear whether import foo refers to a top-level module or to another module inside the package. … foo will always be a module or package reachable from sys.path. This is called an absolute import.” ## See also - [Nightmare with relative imports, how does pep 366 work?](http://stackoverflow.com/questions/2943847) - [Using modules in main.py](http://stackoverflow.com/questions/3411293/using-modules-own-objects-in-main-py)
Shard179 (laksa)
Root Hash13739366623962901379
Unparsed URLcom,philipmolloy!/import.html s443