import issue with classes

Terry Reedy tjreedy at
Tue Jan 3 23:13:11 EST 2012

On 1/3/2012 10:06 PM, Andrew Berg wrote:
> On 1/3/2012 8:50 PM, Rodrick Brown wrote:
>> Import FooA doesn't work and I need to use from FooA import FooA
>> instead? This puzzles me.
>> Thanks.
> If you have a module called FooA with a class called FooA, then import
> FooA imports the /module/. The class would be FooA.FooA, just as the
> variable x from FooA would be FooA.x.

This sort of confusion is why it is not recommended to have file/module 
fooa contain class FooA and why there were some module name changes in Py 3.

Terry Jan Reedy

More information about the Python-list mailing list