## This works, but shouldn't according to https://github.com/google/sling/pull/400#pullrequestreview-263802271

import pywikibot

site = pywikibot.Site('test', 'wikidata')

wp_source_claim = pywikibot.Claim(site, 'P9')
en_wp = pywikibot.ItemPage(site, 'Q21662')
wp_source_claim.setTarget(en_wp)
sources = [wp_source_claim]

test_item = pywikibot.ItemPage(site, 'Q42')
test_claim = pywikibot.Claim(site, 'P126') # patron saint
douglas_adams = pywikibot.ItemPage(site, 'Q42')
test_claim.setTarget(douglas_adams)

test_claim.addSources(sources)
test_item.addClaim(test_claim, summary='source before claim')
Sleeping for 5.0 seconds, 2019-07-19 20:58:47
## This is the exact copy from https://github.com/google/sling/pull/400#pullrequestreview-263802271

import pywikibot
site = pywikibot.Site("wikidata", "wikidata")
repo = site.data_repository()

wp_source_claim = pywikibot.Claim(repo, "P143")
en_wp = pywikibot.ItemPage(repo, "Q328")
wp_source_claim.setTarget(en_wp)
sources = [wp_source_claim]

test_item = pywikibot.ItemPage(repo, "Q4115189")
test_claim = pywikibot.Claim(repo, "P69") # educated at
uni_toledo = pywikibot.ItemPage(repo, "Q2302319")
test_claim.setTarget(uni_toledo)

test_claim.addSources(sources)
test_item.addClaim(test_claim, summary="source before claim")
Sleeping for 8.6 seconds, 2019-07-19 21:00:48
pywikibot.version.getversion()
'[https] r-pywikibot-core.git (71e36c1, g10980, 2019/04/30, 16:42:46, OUTDATED)'