It's currently possible for W0404 (Reimport 'foo') to trigger incorrectly and non-deterministically due to the use of .values(), which returns nodes in an arbitrary order (thereby violating the seemingly obvious semantics of 'get_first_import()'. Attached is a fix that switches from .values() -> .asList() on the context node. This fix works, but looking at Import nodes at all when base is not None seems dubious to me. Regardless, this change corrects the worst issue with this warning.
--Shahms
reimport-false-positive.bundle
Description: Binary data
_______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
