When does a binary extension gets the file extension '.pyd' and when is it '.so'

"Martin v. Löwis" martin at v.loewis.de
Sat Apr 5 17:45:29 EDT 2008


> There must be a rule behind this.

There are multiple rules behind this. Python normally uses
the same extension for shared libraries as the operating
system, as the operating system may refuse to load them if
it doesn't. So it *can't* use .pyd on Unix, because that
might not work (on some implementations of Unix).

It can't use .dll on Windows, because that may (and did)
conflict with existing DLLs, hence it uses .pyd.

Depending on the system, an extension module may have one
of these suffixes:
- .so
- module.so
- .sl
- module.sl
- .exe
- .EXE
- module.exe
- module.EXE
- .pyd
- _d.pyd

Regards,
Martin



More information about the Python-list mailing list