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


Groups > comp.lang.python > #74111

Re: Module name does not match file name

From Robert Kern <robert.kern@gmail.com>
Subject Re: Module name does not match file name
Date 2014-07-07 15:25 +0100
References <53ba52e1$0$2926$c3e8da3$76491128@news.astraweb.com> <53ba60dc$0$2926$c3e8da3$76491128@news.astraweb.com> <mailman.11583.1404731768.18130.python-list@python.org> <53ba8aef$0$29995$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.11595.1404743166.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

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


Thread

Module name does not match file name Steven D'Aprano <steve@pearwood.info> - 2014-07-07 07:57 +0000
  Re: Module name does not match file name Chris Angelico <rosuav@gmail.com> - 2014-07-07 18:04 +1000
    Re: Module name does not match file name Steven D'Aprano <steve@pearwood.info> - 2014-07-07 09:03 +0000
      Re: Module name does not match file name Chris Angelico <rosuav@gmail.com> - 2014-07-07 19:11 +1000
  Re: Module name does not match file name Steven D'Aprano <steve@pearwood.info> - 2014-07-07 08:57 +0000
    Re: Module name does not match file name Chris Angelico <rosuav@gmail.com> - 2014-07-07 19:03 +1000
      Re: Module name does not match file name Steven D'Aprano <steve@pearwood.info> - 2014-07-07 09:28 +0000
    Re: Module name does not match file name Peter Otten <__peter__@web.de> - 2014-07-07 12:41 +0200
    Re: Module name does not match file name Robert Kern <robert.kern@gmail.com> - 2014-07-07 12:15 +0100
      Re: Module name does not match file name Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-07 11:56 +0000
        Re: Module name does not match file name Chris Angelico <rosuav@gmail.com> - 2014-07-07 22:04 +1000
        Re: Module name does not match file name Robert Kern <robert.kern@gmail.com> - 2014-07-07 15:25 +0100

csiph-web