[issue19927] Path-based loaders lack a meaningful __eq__() implementation.

Eric Snow report at bugs.python.org
Sun Dec 22 04:34:26 CET 2013


Eric Snow added the comment:

Right now say you have 2 module specs that are the same.  The only difference is that the 2 loaders are not the same instance (they were created separately with the same arguments, ergo equal).  The two specs will not compare as equal even though they are equal.

I expect users will find it surprising if they compare module.__spec__ to another spec that is basically the same (as described above) and it resolve to not equal.  I can see this as particularly vexing for importer writers that are switching over to the new spec-based APIs.

In my mind, the benefit of removing that unexpected (and aggravating) behavior outweighs the risk that someone is depending on identity-only comparision for the two loader types that are impacted by this change (which were both just added in 3.3).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19927>
_______________________________________


More information about the Python-bugs-list mailing list