[Python-Dev] Another relative imports question (original) (raw)
Chris Withers chris at simplistix.co.uk
Fri Oct 8 10:50:20 CEST 2010
- Previous message: [Python-Dev] question/comment about documentation of relative imports
- Next message: [Python-Dev] Another relative imports question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi All,
The new explicit relative import syntax is great. I wanted to relatively import a module.
import .mymoduleinmypackage
...and got a SyntaxError in Python 2.6.
I guess I need to do:
from . import mymoduleinmypackage
...but it does feel weirdly asymetric that:
from .mymoduleinmypackage import something
...while:
import .mymoduleinmypackage mymoduleinmypackage.something
...does not.
cheers,
Chris
-- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
- Previous message: [Python-Dev] question/comment about documentation of relative imports
- Next message: [Python-Dev] Another relative imports question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]