Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'importing': 0.05; 'true,': 0.05; '(using': 0.07; 'abstraction': 0.09; 'dependency': 0.09; 'skip:/ 10': 0.09; 'subject:design': 0.09; 'collections': 0.16; 'modules.': 0.16; 'periods': 0.16; 'pythonic': 0.16; 'subject:Language': 0.16; 'to:name:python list': 0.16; 'module': 0.19; 'mechanism': 0.19; "python's": 0.19; 'programming': 0.22; 'circular': 0.24; 'sort': 0.25; 'source': 0.25; 'task': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'file': 0.32; 'class': 0.32; 'quite': 0.32; '(i.e.': 0.33; 'guess': 0.33; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'simply': 0.61; 'making': 0.63; 'address': 0.63; 'difficult?': 0.84; 'hooked': 0.84; 'washington': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ost+YrpbFxqTHgVtSWFDL27S0AVZF8gi9n3tFamTM2E=; b=c5zHPR9i5IXzjAY4DNX/P0B0cMGlH8Xi+xcxKb4t8oPzDps4zKj960i9eEEfS2UVtC y6i10+d/1D8VTZNnRKyyJbHAaAqg1oHBvZjgLbsJzjTdubShA6H/8d+JQjiBspPTjoc4 j7JBhPpLrVUvamrG1QnxdZCwjyf6Y87fsaejHN2Jv1p/K0EIOj8m6ue1rBhU+Dl710Bm EkInTuezq6o1H+vvsoO+/MpS2vWuJeMa4vXGOY83K8YyTtRujCK+ZSVu0R/7lfCPBj2Z v2/NCwE59FOl78iquT2ZT73BOpidTUP9eiuT2LGeLcWgzV9nsdiU+WAOtE4YK+XDj4rz DgZA== MIME-Version: 1.0 X-Received: by 10.180.206.129 with SMTP id lo1mr19328185wic.15.1378946082555; Wed, 11 Sep 2013 17:34:42 -0700 (PDT) In-Reply-To: <7wy5730wv5.fsf@benfinney.id.au> References: <522eb795$0$29999$c3e8da3$5496439d@news.astraweb.com> <7wbo412m02.fsf@benfinney.id.au> <7wy5730wv5.fsf@benfinney.id.au> Date: Wed, 11 Sep 2013 17:34:42 -0700 Subject: Re: Language design From: Mark Janssen To: Python List Content-Type: text/plain; charset=ISO-8859-1 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: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378946090 news.xs4all.nl 15958 [2001:888:2000:d::a6]:44584 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54016 >> Why is this so difficult? >> Add a Graph class to the collections module (networkx is quite good) >> and simply check for circular imports. > > Er? That doesn't address the task of importing a module from a source > code file given its path on the filesystem. That's true, I guess was hooked on Python's abstraction mechanism for making the file system invisible. But I like the idea of programming *relative* path addressing, so you can create a sort of "name space" for your modules. So instead of "import /path/to/file.py" which makes a system dependency (i.e. *yours*), you could have "import TestPackage.collections.bag" (using periods for file path separators in keeping with the Pythonic Way). -- MarkJ Tacoma, Washington