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/2013-April/125126.html below:

[Python-Dev] relative import circular problem

[Python-Dev] relative import circular problem [Python-Dev] relative import circular problemCameron Simpson cs at zip.com.au
Thu Apr 4 23:45:36 CEST 2013
On 03Apr2013 12:12, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
| Kristján Valur Jónsson wrote:
| >However, relative imports can _only_ be performed using the "from X import Y syntax"
| 
| This seems like a legitimate complaint on its own, [...]
| There are a couple of ways that this could be resolved. One
| would be to use the name resulting from stripping off the
| leading dots, so that
|    import .foo
| would bind the module to the name 'foo'.

+0 from me (I'd have been +0.5 but for Guido's explaination about
"import X" generally letting you use "X" exactly as phrased in the
import).

| Another would be
| to always require an 'as' clause in this case, so that you
| would have to write'
|    import .foo as foo

And a big +1 for this.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>

The Force. It surrounds us; It enfolds us; It gets us dates on Saturday
Nights. - Obi Wan Kenobi, Famous Jedi Knight and Party Animal.
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