Reported (and fixed) by this pull request: https://github.com/mongodb/mongo-python-driver/pull/337
The bug is that two bson.Regex's with the same flags but different pattern will compare equal:
>>> from bson import Regex >>> Regex('a') == Regex('b') True