[Tutor] module Cyclic references

Karthik Gurumurthy karthikg@aztec.soft.net
Mon, 7 Jan 2002 00:30:49 +0530


thanks Andy

this is what am getting
the error is being signalled by price.py
which has

from movie import Movie, Rental

as the first line

>>> import movie
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "movie.py", line 1, in ?
    import price
  File "price.py", line 1, in ?
    from movie import Movie, Rental
ImportError: cannot import name Movie
>>>

-----Original Message-----
From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
Andy W
Sent: Monday, January 07, 2002 12:08 AM
To: python-list@python.org
Cc: tutor@python.org
Subject: Re: [Tutor] module Cyclic references


> hi all,

Hi

> my code is behaving in a strange way.

Goody, I like strange things. *gets to the task at hand*

> >>> import test
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "test.py", line 1, in ?
>     from movie import Movie, Rental
>   File "movie.py", line 1, in ?
>     import price
>   File "price.py", line 1, in ?
>     from movie import Movie, Rental
> ImportError: cannot import name Movie
> >>>
>
> This sequence works just fine!
> >>> import price
> >>> import movie
> >>> import cust
> >>> import test

Umm this sounds too simple to be true, but is there a typo or something?
Unless I'm totally wrong, and someone smarter and more brilliant comes up
with a different answer, can you please do the following:

###
import movie
print dir(movie)
###

and then email again what it comes up with.

Andy W

>
> thanks
> karthik.
>
> -----Original Message-----
> From: python-list-admin@python.org
> [mailto:python-list-admin@python.org]On Behalf Of marco
> Sent: Saturday, December 22, 2001 5:48 AM
> To: python-list@python.org
> Subject: Re: vi or emacs for editing Python on Linux?
>
>
> "maxm" <maxm@mxm.dk> writes:
>
> > One of my biggest problems in switching is my editor. On windows I use
> > Ultraedit as a general editor, and i type really fast in it. Knowing the
> > shortcuts and all. Every time I boot up one of my Linux machines I have
a
> > hard time editing files under the arcane unix editors. I have tried both
> > emacs and vim and I disklike both!
>
> Maybe Nedit is good for Windows people: www.nedit.org
> (but I use emacs myself -- those "arcane" editors are
> tried and true).
>
> --
> mdlch@altavista.net
> Gunnm: Broken Angel
> http://reimeika.ca/
> --
> http://mail.python.org/mailman/listinfo/python-list
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor