Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18487 > unrolled thread

Re: import issue with classes

Started byTerry Reedy <tjreedy@udel.edu>
First post2012-01-03 23:13 -0500
Last post2012-01-03 23:13 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: import issue with classes Terry Reedy <tjreedy@udel.edu> - 2012-01-03 23:13 -0500

#18487 — Re: import issue with classes

FromTerry Reedy <tjreedy@udel.edu>
Date2012-01-03 23:13 -0500
SubjectRe: import issue with classes
Message-ID<mailman.4400.1325650410.27778.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web