I started off with a module that defined a class Vehicle, and then
subclasses Car and Motorcycle.

In the Car class,  for some bizarre reason, I instantiated a Motorcycle.
Please pretend that this can't be avoided for now.

Meanwhile, my Motorcycle class instantiated a Car as well.

Then I moved the Car and Motorcycle classes into separate files.  Each
imported the Vehicle module.

Then I discovered that my Car module failed because the global
Motorcycle wasn't defined.  The same problem happened in my Motorcycle
module.  Car and Motorcycle can't both import each other.

In the beginning, when all three (Vehicle, Car, and Motorcycle) were
defined in the same file, everything worked fine.

I don't know how to split them out in separate files now though and I
really wish I could because the single file is enormous.

Any ideas?

Matt




--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to