A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-October/104543.html below:

[Python-Dev] Another relative imports question

[Python-Dev] Another relative imports question [Python-Dev] Another relative imports questionChris Withers chris at simplistix.co.uk
Fri Oct 8 10:50:20 CEST 2010
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4