Currently qualifiers are misidentified as references when fromJSON() is called on the parent claim.
To test:
$ python pwb.py shell Welcome to the Pywikibot interactive shell! >>> repo = pywikibot.Site('wikidata', 'wikidata').data_repository() >>> item = pywikibot.ItemPage(repo, 'Q4115189') >>> item.exists() True >>> c = item.claims['P800'][0] >>> sc = c.sources[1]['P813'][0] >>> qc = c.qualifiers['P580'][0] >>> qc.isReference True >>> qc.isQualifier False >>> sc.isReference True >>> sc.isQualifier False
https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q4115189 contains
... "P800": [ { "mainsnak": { "snaktype": "value", "property": "P800", "datavalue": { "value": { "entity-type": "item", "numeric-id": 4115189 }, "type": "wikibase-entityid" }, "datatype": "wikibase-item" }, "type": "statement", "qualifiers": { "P580": [ { "snaktype": "value", "property": "P580", "hash": "a1e9eb581e4e1ce68f837f4e7f2751373180abd8", "datavalue": { "value": { "time": "+1901-02-03T00:00:00Z", "timezone": 0, "before": 0, "after": 0, "precision": 11, "calendarmodel": "http://www.wikidata.org/entity/Q1985727" }, "type": "time" }, "datatype": "time" } ] }, "qualifiers-order": [ "P580" ], "id": "Q4115189$e3d28f24-4982-a547-985d-136e972fd58a", "rank": "normal", "references": [ { "hash": "7ad766a38be5f2a6af31d4dffea0ba491be0e0bf", "snaks": { "P50": [ { "snaktype": "value", "property": "P50", "datavalue": { "value": { "entity-type": "item", "numeric-id": 14411 }, "type": "wikibase-entityid" }, "datatype": "wikibase-item" } ] }, "snaks-order": [ "P50" ] }, { "hash": "f172f7e0b94254fcdaaf9027714322a06e9872a8", "snaks": { "P813": [ { "snaktype": "value", "property": "P813", "datavalue": { "value": { "time": "+2014-11-29T00:00:00Z", "timezone": 0, "before": 0, "after": 0, "precision": 11, "calendarmodel": "http://www.wikidata.org/entity/Q1985727" }, "type": "time" }, "datatype": "time" } ], "P854": [ { "snaktype": "value", "property": "P854", "datavalue": { "value": "https://www.wikidata.org/wiki/Q4115189", "type": "string" }, "datatype": "url" } ] }, "snaks-order": [ "P813", "P854" ] } ] } ], ...
There we can see hash in both qualifiers and references, however the hash is at a different 'level' in the JSON.
I have a quick patch which simply moves the isQualifier/isReference assignment to the qualifierFromJSON()/referenceFromJSON() methods. However since I'm unsure if fromJSON() is ever called directly on a qualifer/reference I'm not sure whether this is enough.