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


Groups > comp.lang.python > #18491

Re: import issue with classes

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'imports': 0.07; 'received:verizon.net': 0.07; 'subject:issue': 0.07; 'terry': 0.07; '*is*': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'case.': 0.15; 'reedy': 0.16; 'subject:classes': 0.16; 'subject:import': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'jan': 0.19; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'module': 0.26; 'thanks.': 0.26; 'import': 0.27; 'variable': 0.28; 'pm,': 0.29; 'class': 0.29; 'confusion': 0.30; 'andrew': 0.32; 'changes': 0.32; 'sort': 0.33; 'header:User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.33; 'there': 0.33; 'to:addr:python-list': 0.34; 'subject:with': 0.36; '(to': 0.37; 'received:org': 0.38; 'some': 0.38; 'recommended': 0.39; 'why': 0.39; 'called': 0.40; 'to:addr:python.org': 0.40; 'brown': 0.80
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: import issue with classes
Date Wed, 04 Jan 2012 02:03:19 -0500
References <CABRP1o9vGVQLQ0GE41S5kuXW1DLroKYtkvZN-VH9C73CTR46Ug@mail.gmail.com> <4F03C24F.9010703@gmail.com> <je0jkr$lr9$1@dough.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-74-109-121-73.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
In-Reply-To <je0jkr$lr9$1@dough.gmane.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4406.1325660615.27778.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325660615 news.xs4all.nl 6869 [2001:888:2000:d::a6]:53099
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18491

Show key headers only | View raw


On 1/3/2012 11:13 PM, Terry Reedy wrote:
> 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

why it *is* recommended (to have different names) and not recommended to 
have the same name, including case.

> fooa contain class FooA and why there were some module name changes in
> Py 3.
>


-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web