[Python-Dev] Proposed Python api for testing whether a module exists

Edward Loper edloper at gradient.cis.upenn.edu
Mon Aug 2 19:50:42 CEST 2004


> I propose to add the following function to the imp module:
> 
>   exists(module_name)
> 
>      Test whether the named module can be found.  [...]
>      If a dotted module name is given, then parent modules will be
>      imported if they haven't already been imported.

If a parent module doesn't exist, will it return False or raise an 
ImportError?

-Edward


More information about the Python-Dev mailing list

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant