Steps to replicate the issue (include links if applicable):
site = pywikibot.Site("test", "wikidata")
item = pywikibot.ItemPage(site, "Q229226")
prop = pywikibot.PropertyPage(site, "P97339")
claim = pywikibot.Claim(site, prop.id)
claim.setTarget("test")
item.claims.setdefault(claim.id, []).append(claim)
item.editEntity()
prop = pywikibot.PropertyPage(site, "P97340")
claim = pywikibot.Claim(site, prop.id)
claim.setTarget(pywikibot.ItemPage(site, "Q229227"))
item.claims.setdefault(claim.id, []).append(claim)
item.editEntity()What happens?: The claim [P97339, "test"] is inserted twice.
What should have happened instead?: It is inserted once
Software version (skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):