Question about circular imports

Frank Millman frank at
Mon Feb 27 01:16:47 EST 2012

> To avoid the tedious reference, follow this with
> read = sound.formats.wavread # choose the identifier you prefer

@Terry and OKB

I tried that, but it does not work.
/b -
    from b import c -
    import b.d -
    import b.c

If I run, it returns with no error. -
    import b.d
    d = b.d -
    import b.c
    c = b.c

If I run, I get

Traceback (most recent call last):
  File "F:\tests\", line 1, in <module>
    from b import c
  File "F:\tests\b\", line 1, in <module>
    import b.d
  File "F:\tests\b\", line 2, in <module>
    c = b.c
AttributeError: 'module' object has no attribute 'c'

I get the same if I try 'import b.c as c'.


More information about the Python-list mailing list