[Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen
Nathaniel Smith
njs at pobox.com
Thu Oct 29 19:56:38 EDT 2015
More information about the Python-Dev mailing list
Thu Oct 29 19:56:38 EDT 2015
- Previous message (by thread): [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen
- Next message (by thread): [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Oct 29, 2015 at 1:50 PM, Ryan Gonzalez <rymg19 at gmail.com> wrote: > Why not just check the path of the imported modules and compare it with the > Python library directory? It works, but it requires that everyone who could run into this problem carefully add some extra guard code to every stdlib import statement, and in practice nobody will (or at least, not until after they've already gotten bitten by this at least once... at which point they no longer need it). Given that AFAICT there's no reason this couldn't be part of the default import system's functionality and "just work" for everyone, if I were going to spend time on trying to fix this I'd probably target that :-). (I guess the trickiest bit would be to find an efficient and maintainable way to check whether a given package name is present in the stdlib.) -n -- Nathaniel J. Smith -- http://vorpus.org
- Previous message (by thread): [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen
- Next message (by thread): [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list