Currently a pywikibot.Link._cmpkey() returns (self.site, self.namespace, self.title). The documentation however states that section must also be the same for equality.
Either the docstring or the return value should be updated. Adding section would however be a breaking change.
This was one of the @TODOs from gerrit:442168