[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] How to handle circular imports
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2009-07-09 20:53:09
Message-ID: 84629228949ebd636705dc4788808c9a () localhost
[Download RAW message or body]
On Thu, 9 Jul 2009 22:32:28 +0200, "Jakob Simon-Gaarde" <sip@skolesys.dk>
wrote:
> Hey there.
>
> I have a problem regarding sip that I guess is probably trivial.
>
> I have an C++ API which is contained in one library file. I am over half
> way
> though making python bindings. In the process of making these bindings I
> decided to split them op into 7 modules that each handle there logical
> partition of the problem domain, ie UserService, GroupService,
RoleService,
>
> etc.
>
> Until now it has been smooth, I created sip definitions for 20% of the
> UserService module and when implementing the RoleService I needed
> specifications from the UserService (UserItem) so I %Import'ed the
> UserService
> Module in RoleService. Everything worked as it should.
>
> Then when I wanted to define the remaining 80% of the UserService module
I
> also needed definitions from RoleService in UserService (RoleItem)...
But,
> but, but here I ran into problems, cause when I in the RoleService
module's
>
> sip definitions already imported UserService, I got a circular import
when
> I
> started importing RoleService in UserService.
>
> Is this possible to work around?
Only by redesigning your module structure to remove the circular
dependencies.
> the prob:
> this is what happens in sip while processing module A:
> A imports B which then import A
>
> cause A depends on specs from B and B depends on specs from A
>
> / Jakob Simon-Gaarde
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic