Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'problem?': 0.07; 'ambiguity': 0.09; 'builtin': 0.09; 'fullname': 0.09; 'sure,': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.11; 'collections': 0.16; 'from:addr:gnu.org': 0.16; 'idea:': 0.16; 'subject:import': 0.16; 'sys.path': 0.16; 'underlying': 0.16; 'wrote:': 0.18; 'module': 0.19; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; "aren't": 0.24; 'fixed.': 0.24; 'helpful': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'right.': 0.26; 'post': 0.26; 'header:In-Reply- To:1': 0.27; 'code': 0.31; '25,': 0.31; 'programmers': 0.33; "can't": 0.35; 'received:209.85': 0.35; 'tool': 0.35; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'right?': 0.36; 'should': 0.36; 'changing': 0.37; 'received:209': 0.37; 'pm,': 0.38; 'von': 0.38; 'rather': 0.38; 'bad': 0.39; 'called': 0.40; 'march': 0.61; 'times': 0.62; "you've": 0.63; 'address': 0.63; 'name': 0.63; 'kind': 0.63; 'here': 0.66; 'mar': 0.68; '26,': 0.68; 'moves': 0.84; 'hill': 0.95; '2013': 0.98 X-Received: by 10.49.85.35 with SMTP id e3mr1166182qez.7.1364323317424; Tue, 26 Mar 2013 11:41:57 -0700 (PDT) Newsgroups: comp.lang.python Date: Tue, 26 Mar 2013 11:41:57 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.183.236.17; posting-account=jKjGDQoAAABKN2iauJtD3DV5oMZpXuQo References: <514f9a0b$0$30001$c3e8da3$5496439d@news.astraweb.com> <0f669e21-5fd1-402e-9d96-55aa647d1030@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 71.183.236.17 MIME-Version: 1.0 Subject: Re: import in Python3.3 From: rocky To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364323326 news.xs4all.nl 6920 [2001:888:2000:d::a6]:49134 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41937 On Tuesday, March 26, 2013 12:33:54 PM UTC-4, Jerry Hill wrote: > On Mon, Mar 25, 2013 at 11:49 PM, rocky wrote: >=20 > >> On Sun, 24 Mar 2013 18:12:49 -0500, Fabian von Romberg wrote: >=20 > >> > I have a package name collections and inside of my package I want to >=20 >=20 >=20 > > I find this kind of thing sad: it feels to me that programmers are work= ing around somewhat arbitrary and changing restrictions. Rather than avoid = names like "collections", why not try to address the underlying problem? Th= ere isn't an ambiguity here in my view: the fullname is mypackage.collectio= ns >=20 >=20 >=20 > You've said a couple of times now that the original author has a >=20 > package named "mypackage" with a module "collections" in it. As far >=20 > as I can tell, that's untrue. The original post claims to have a >=20 > package named "collections", which is colliding with the builtin >=20 > module of the same name. >=20 >=20 >=20 > As far as I can tell, all of your suggestions about using your >=20 > pyimport-relative tool aren't helpful unless the author re-names his >=20 > package from "collections" to "mypackage" and then moves all of their >=20 > code into a "collections" module inside "mypackage", right? Right. Perhaps then I misunderstand. Having a package called "collections" = when there is something out there already called "collections" clearly ill = advised.=20 But in that case, using sys.path to get around this is still a bad idea: th= e clash should be fixed. Sure, only in the case that this really can't be a= ddressed would I use sys.path. >=20 >=20 >=20 > --=20 >=20 > Jerry