unexpected "cannot find reference" when accessing dict in Pycharm

Answered

Hi,

When creating a dictionary with embedded dictionaries and later adding a list to it, Pycharm "cannot find the reference" for this item's list functions

Minimum example code:

d = {"a": {}}

d["b"] = []

d["b"].append(1)

Code inspection for this example shows "Cannot find reference 'append' in 'str | dict'" (even though it works obviously)

Is this intended?

0
2 comments
Avatar
Permanently deleted user

That is indeed unfortunate. Thank you for clarifying!

0

Please sign in to leave a comment.