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


Groups > comp.lang.python > #41937

Re: import in Python3.3

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 <rocky@gnu.org>
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 <mailman.3754.1364315646.2939.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=71.183.236.17; posting-account=jKjGDQoAAABKN2iauJtD3DV5oMZpXuQo
References <mailman.3685.1364166787.2939.python-list@python.org> <514f9a0b$0$30001$c3e8da3$5496439d@news.astraweb.com> <0f669e21-5fd1-402e-9d96-55aa647d1030@googlegroups.com> <mailman.3754.1364315646.2939.python-list@python.org>
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 <rocky@gnu.org>
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 <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>
Message-ID <mailman.3766.1364323326.2939.python-list@python.org> (permalink)
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

Show key headers only | View raw


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:
> 
> >> On Sun, 24 Mar 2013 18:12:49 -0500, Fabian von Romberg wrote:
> 
> >> > I have a package name collections and inside of my package I want to
> 
> 
> 
> > I find this kind of thing sad: it feels to me that programmers are working around somewhat arbitrary and changing restrictions. Rather than avoid names like "collections", why not try to address the underlying problem? There isn't an ambiguity here in my view: the fullname is mypackage.collections
> 
> 
> 
> You've said a couple of times now that the original author has a
> 
> package named "mypackage" with a module "collections" in it.  As far
> 
> as I can tell, that's untrue.  The original post claims to have a
> 
> package named "collections", which is colliding with the builtin
> 
> module of the same name.
> 
> 
> 
> As far as I can tell, all of your suggestions about using your
> 
> pyimport-relative tool aren't helpful unless the author re-names his
> 
> package from "collections" to "mypackage" and then moves all of their
> 
> 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. 

But in that case, using sys.path to get around this is still a bad idea: the clash should be fixed. Sure, only in the case that this really can't be addressed would I use sys.path.

> 
> 
> 
> -- 
> 
> Jerry

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


Thread

import in Python3.3 Fabian von Romberg <fromberg100@hotmail.com> - 2013-03-24 18:12 -0500
  Re: import in Python3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-25 00:27 +0000
    Re: import in Python3.3 Fabian von Romberg <fromberg100@hotmail.com> - 2013-03-24 20:39 -0500
    Re: import in Python3.3 rocky <rocky@gnu.org> - 2013-03-25 20:49 -0700
      Re: import in Python3.3 Jerry Hill <malaclypse2@gmail.com> - 2013-03-26 12:33 -0400
        Re: import in Python3.3 rocky <rocky@gnu.org> - 2013-03-26 11:41 -0700
        Re: import in Python3.3 rocky <rocky@gnu.org> - 2013-03-26 11:41 -0700
        Re: import in Python3.3 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-26 23:11 +0000

csiph-web