On Sun, Aug 23, 2020 at 10:14 AM Gustav O email@example.com wrote:
I agree — having a warning would be fantastic! Personally, I think the minor speed drawback of checking the full path would be worth it, in most cases. The fact that a module is being shadowed is really valuable information to have.
A speed drawback on every import would almost certainly be too high a price to pay. Maybe this would make a useful excepthook? If an AttributeError is about to be printed to the console, and the failing object is a module, *then* look through the path and see if it was shadowed.