Ronald:
> BTW. A list of stdlib module names is not sufficient to determine if a module is in the stdlib, thanks to .pth files it is possible to have entries on sys.path before the stdlib.
Yeah, I wrote it in my first message. I solved this issue with documentation:
"Note: If a third party module has the same name than a standard library module and it comes before the standard library in sys.path, it overrides the standard library module on import."
I updated sys.module_names documentation in my PR.
IMO it's an acceptable limitation. |