I have a module, Mod1, in both Mod1.py and Mod1.pyd format in the same folder. Is there a way to know which version the main.py file has imported? I know Python prioritises pyd files, but I need to have the main script make sure.
I tried using the module's __file__ attribute, but the extension is still .py even after compiling to .pyd. I removed the py file to make sure it was the pyd's __file__ I was printing. I compiled the module with nuitka. Is the __file__ attribute not set at run time based on the actual file?