Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!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; 'languages.': 0.04; 'importing': 0.05; 'expectation': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:design': 0.09; 'python': 0.11; 'collections': 0.16; 'filesystem,': 0.16; 'finney': 0.16; 'imports': 0.16; 'janssen': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Language': 0.16; 'module': 0.19; 'import': 0.22; 'header:User-Agent:1': 0.23; 'circular': 0.24; 'source': 0.25; 'equivalent': 0.26; 'task': 0.26; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; "doesn't": 0.30; "i'm": 0.30; 'code': 0.31; 'writes:': 0.31; 'file': 0.32; 'class': 0.32; 'languages': 0.32; 'quite': 0.32; 'but': 0.35; 'add': 0.35; 'ben': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'simply': 0.61; 'simple': 0.61; "you'll": 0.62; 'address': 0.63; 'more': 0.64; 'nobody': 0.68; 'complex,': 0.84; 'difficult?': 0.84; 'hill': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Language design Date: Thu, 12 Sep 2013 09:19:58 +1000 References: <522eb795$0$29999$c3e8da3$5496439d@news.astraweb.com> <7wbo412m02.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: rasputin.madmonks.org X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:lJkpkcTxoCbFFuUYBrFZ3uE8r6M= 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378942208 news.xs4all.nl 15878 [2001:888:2000:d::a6]:41882 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54007 Mark Janssen writes: > > * Imports are fiendishly complex, hidden below deceptively simple > > syntax. > > > > It's a reasonable expectation that one can import a module from a > > source code file given its path on the filesystem, but this turns out > > to be much more complicated than in many other languages. > > Why is this so difficult? I don't know, you'll have to ask the people who designed it that way. > 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. Other languages have the equivalent of ‘include "/path/to/file.py"’, but Python doesn't. That's the misdesign I'm describing. -- \ “Just because nobody complains doesn't mean all parachutes are | `\ perfect.” —Benny Hill | _o__) | Ben Finney