Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4.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; 'subject:not': 0.03; 'rename': 0.07; 'subject:file': 0.07; 'pep': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '"run': 0.16; '(assuming': 0.16; 'kern': 0.16; 'maintainer': 0.16; 'modules.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'special.': 0.16; 'underlying': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'code,': 0.22; 'header:User- Agent:1': 0.23; "aren't": 0.24; 'documented': 0.24; 'interpret': 0.24; 'mon,': 0.24; 'source': 0.25; 'extension': 0.26; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'robert': 0.30; '+0100,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'though.': 0.31; 'file': 0.32; 'maybe': 0.34; 'but': 0.35; 'so,': 0.37; 'to:addr:python-list': 0.38; 'little': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'new': 0.61; 'our': 0.64; 'world': 0.66; 'believe': 0.68; 'jul': 0.74; 'behavior': 0.77; 'eco': 0.84; 'find.': 0.84; 'recompile': 0.84; 'terrible': 0.84; 'forever.': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: Module name does not match file name Date: Mon, 07 Jul 2014 15:25:36 +0100 References: <53ba52e1$0$2926$c3e8da3$76491128@news.astraweb.com> <53ba60dc$0$2926$c3e8da3$76491128@news.astraweb.com> <53ba8aef$0$29995$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 213.1.240.226 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <53ba8aef$0$29995$c3e8da3$5496439d@news.astraweb.com> 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404743166 news.xs4all.nl 2952 [2001:888:2000:d::a6]:59710 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74111 On 2014-07-07 12:56, Steven D'Aprano wrote: > On Mon, 07 Jul 2014 12:15:51 +0100, Robert Kern wrote: > >> On 2014-07-07 09:57, Steven D'Aprano wrote: >>> What I don't understand is how "import pg" gets turned into "run >>> pgmodule.so"? >> >> This has been standard Python behavior for extension modules since >> forever. It's a very old practice and not recommended for new code, >> though. > > Hmmm. Well, that is very special. Is this documented anywhere? Not that I can find. Maybe the PEP that removed it for Python 3 might document it implicitly. > I know very little about extension modules. If I just rename the source > file from pgmodule.c to pg.c, recompile to pg.so, and use that in place > of pgmodule.so, is anything likely to break? I don't think so, but why would you bother (assuming you aren't the maintainer of pgmodule.so)? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco