-Dev [mailto:python-dev-
bounces+kristjan=ccpgames@python.org] On Behalf Of Richard
Oudkerk
Sent: 4. apríl 2013 16:26
To: python-dev@python.org
Subject: Re: [Python-Dev] relative import circular problem
How about having a form of relative import which only works for
submodules
-Original Message-
From: PJ Eby [mailto:p...@telecommunity.com]
Sent: 4. apríl 2013 20:29
To: Guido van Rossum
Cc: Kristján Valur Jónsson; Nick Coghlan; python-dev@python.org
Subject: Re: [Python-Dev] relative import circular problem
So, this is actually an implementation quirk
; python-dev@python.org
Subject: Re: [Python-Dev] relative import circular problem
+1 on Brett and PJE just doing this.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
-Original Message-
From: Eric Snow [mailto:ericsnowcurren...@gmail.com]
Sent: 4. apríl 2013 04:57
imported by both of the original modules. At that point, the code is
cleaner and more decoupled, and the uneven circular import support
ceases to be a problem for that application.
On 4 Apr 2013 19:37, Kristján Valur Jónsson krist...@ccpgames.com wrote:
-Original Message-
From: Eric Snow [mailto:ericsnowcurren...@gmail.com]
Sent: 4. apríl 2013 04:57
imported by both of the original modules. At that point, the code is
cleaner and more decoupled, and the
On Thu, Apr 4, 2013 at 2:36 AM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
[...]
There can be good and valid reasons to put things that depend on each
other in separate modules, for example when trying to separate modules by
functionality or simply when splitting a long file into
On 04/04/2013 4:17pm, Guido van Rossum wrote:
I don't really see what we could change to avoid breaking code in any
particular case -- the burden is up to the library to do it right. I
don't see a reason to forbid any of this either.
How about having a form of relative import which only works
Redirecting to python-ideas.
On Thu, Apr 4, 2013 at 9:26 AM, Richard Oudkerk shibt...@gmail.com wrote:
On 04/04/2013 4:17pm, Guido van Rossum wrote:
I don't really see what we could change to avoid breaking code in any
particular case -- the burden is up to the library to do it right. I
On Thu, Apr 4, 2013 at 11:17 AM, Guido van Rossum gu...@python.org wrote:
I don't really see what we could change to avoid breaking code in any
particular case
Actually, the problem has *nothing* to do with circularity per se;
it's that import a.b and from a import b behave differently in
terms
Thanks for the insight. That could indeed be done and I would
encourage someone to come up with a fix.
FWIW there is another difference between the two forms -- from a
import b allows b to be any attribute of a, whereas import a.b
requires b to be a submodule of a. I don't want to compromise on
On Thu, Apr 4, 2013 at 4:42 PM, Guido van Rossum gu...@python.org wrote:
I do think it would be fine if from a import b returned the
attribute 'b' of module 'a' if it exists, and otherwise look for
module 'a.b' in sys.modules.
Technically, it already does that -- but inside of __import__, not
On 03Apr2013 12:12, Greg Ewing greg.ew...@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
On Thu, Apr 4, 2013 at 5:00 PM, PJ Eby p...@telecommunity.com wrote:
On Thu, Apr 4, 2013 at 4:42 PM, Guido van Rossum gu...@python.org wrote:
I do think it would be fine if from a import b returned the
attribute 'b' of module 'a' if it exists, and otherwise look for
module 'a.b' in
+1 on Brett and PJE just doing this.
On Thu, Apr 4, 2013 at 3:38 PM, Brett Cannon br...@python.org wrote:
On Thu, Apr 4, 2013 at 5:00 PM, PJ Eby p...@telecommunity.com wrote:
On Thu, Apr 4, 2013 at 4:42 PM, Guido van Rossum gu...@python.org wrote:
I do think it would be fine if from a
On Apr 4, 2013 6:47 PM, Guido van Rossum gu...@python.org wrote:
+1 on Brett and PJE just doing this.
I'll file a bug when I get home.
-brett
On Thu, Apr 4, 2013 at 3:38 PM, Brett Cannon br...@python.org wrote:
On Thu, Apr 4, 2013 at 5:00 PM, PJ Eby p...@telecommunity.com wrote:
http://bugs.python.org/issue17636
On Thu, Apr 4, 2013 at 8:03 PM, Brett Cannon br...@python.org wrote:
On Apr 4, 2013 6:47 PM, Guido van Rossum gu...@python.org wrote:
+1 on Brett and PJE just doing this.
I'll file a bug when I get home.
-brett
On Thu, Apr 4, 2013 at 3:38 PM,
On Mon, Apr 1, 2013 at 4:52 PM, Nick Coghlan ncogh...@gmail.com wrote:
This is really a quality-of-implementation issue in the import system rather
than a core language design problem. It's just that those of us with the
knowledge and ability to fix it aren't inclined to do so because circular
2013 22:38
To: Kristján Valur Jónsson
Cc: python-dev@python.org
Subject: Re: [Python-Dev] relative import circular problem
the latter works with partially initialized modules, but not the former,
rendering two sibling modules unable to import each other using the relative
syntax.
Clarification
: Re: [Python-Dev] relative import circular problem
with partially initialized modules, but not the former, rendering two sibling
modules unable to import each other using the relative syntax.
This is really a quality-of-implementation issue in the import system rather
than a core language
-Original Message-
From: Python-Dev [mailto:python-dev-
bounces+kristjan=ccpgames@python.org] On Behalf Of Barry Warsaw
Sent: 1. apríl 2013 22:16
To: python-dev@python.org
Subject: Re: [Python-Dev] relative import circular problem
On Apr 01, 2013, at 08:20 PM, Kristján Valur
Le Tue, 2 Apr 2013 09:28:17 +,
Kristján Valur Jónsson krist...@ccpgames.com a écrit :
Right, as I explained in my reply to Barry, I was imprecise.
But the “from X import Y” is the only way to invoke relative imports,
where X can have leading dots. This syntax places the constraint on X
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, regardless
of the circular import issue. The principle of least surprise
suggests that relative imports should be possible using
I just ran into the issue described in
http://stackoverflow.com/questions/6351805/cyclic-module-dependencies-and-relative-imports-in-python.
This is unfortunate, because we have been trying to move towards relative
imports in order to aid flexibility in package and library design.
The relative
On Apr 01, 2013, at 08:20 PM, Kristján Valur Jónsson wrote:
The relative import syntax
(from foo import bar) is a getattr type of lookup (i.e. import foo, then get
attr from it).
This is in contrast with absolute import
import foo.bar (get the module foo.bar from sys.modules or import it)
On Mon, Apr 1, 2013 at 4:20 PM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
I just ran into the issue described in
http://stackoverflow.com/questions/6351805/cyclic-module-dependencies-and-relative-imports-in-python
.
This is unfortunate, because we have been trying to move towards
On Tue, Apr 2, 2013 at 6:20 AM, Kristján Valur Jónsson
krist...@ccpgames.com wrote:
I just ran into the issue described in
http://stackoverflow.com/questions/6351805/cyclic-module-dependencies-and-relative-imports-in-python
.
This is unfortunate, because we have been trying to move towards
26 matches
Mail list logo