import and scope inconsistency?

Jim jbo at cannedham.ee.ed.ac.uk
Mon Apr 4 06:23:53 EDT 2005


I would be very grateful for help on the following.

I have the following modules in a program. Names changed to protect the
innocent.

1.Simulation
2.Branches
3.MyFiles

I import Branches, Myfiles and the publicly available module Numeric
inside Simulation.

Branches and MyFiles both contain class definitions.

I can call MyFiles methods inside methods of the Brances classes.
I cannot call Numeric methods inside methods of the Brances classes.

1. I was surprised I could call MyFiles methods in Branches methods.
2. Since I was used to using modules imported in the parent module I was
surprised I couldn't use Numeric methods.

What's going on?

Thanks
Jim O'Donnell



More information about the Python-list mailing list