Incorrect "unresolved attribute reference" in dict Follow
Answered
If I define the following block:
d = {
'prop1': defaultdict(int),
'prop2': defaultdict(list)
}
d['prop2']['entry1'].append(1)
I am getting "Unresolved attribute reference 'append' for class 'int'" which is obviously untrue because d['prop2'] is a defaultdict(list) not int.
Please sign in to leave a comment.
Hi,
I do not have such warning. What is your PyCharm version?
Are there any custom plugins in use?
2018.1 x64. No plugins.
Tried with 2018.1.6, still no warning.
Try File | Invalidate Caches / Restart... or update to a newer version of PyCharm.