[Python-ideas] class ModuleNotFoundError(ImportError)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 1 01:18:23 CET 2011


cool-RR wrote:

> I think modules sometimes raise `ImportError` because of problematic 
> circular imports.

It might be more logical if the case where the module is found
but a requested name is not present in it raised AttributeError
or NameError instead of ImportError. I don't think I've ever had
a situation where conflating them both into ImportError was helpful.

ImportError itself would then have the meaning of the proposed
ModuleNotFoundError.

-- 
Greg



More information about the Python-ideas mailing list