[Python-ideas] Avoid circular import
anatoly techtonik
techtonik at gmail.com
Tue Apr 10 14:35:16 CEST 2012
On Tue, Apr 10, 2012 at 3:03 PM, Oleg Broytman <phd at phdru.name> wrote:
> On Tue, Apr 10, 2012 at 02:24:18PM +0300, Victor Varvariuc <victor.varvariuc at gmail.com> wrote:
>> On Tue, Apr 10, 2012 at 12:55 PM, Oleg Broytman <phd at phdru.name> wrote:
>>
>> > My opinion is - restructure code to avoid circular import instead of
>> hacking import machinery.
>>
>> It's not feasible sometimes.
JFY here is an example how to make it in general case.
http://codereview.appspot.com/5449109/
>> See:
>> http://stackoverflow.com/questions/1556387/circular-import-dependency-in-python
Do you really fighting with this specific case? There is a solution to
that with delayed import.
More information about the Python-ideas
mailing list