Open pylint-bot opened 8 years ago
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: PCManticore):
It might be worth to have a fallback on the pure Python import, if it is available. But since we don't know apriori which import is for a C extension, this could happen whenever a TryExcept is met with two imports on each branch.
Originally reported by: BitBucket: ceridwenv, GitHub: ceridwenv
For instance, look at lazy_object_proxy.
This happens because in lazy_object_proxy's
__init__.py
, the C accelerator is tried first. This is a typical pattern.Then, the module importing subsystem ends up building an empty module for lazy_object_proxy.cext.
This happens even on PyPy and Jython, so the presence of any C accelerator will break inference for the pure Python equivalent.