unexpected "cannot find reference" when accessing dict in Pycharm
已回答
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?
请先登录再写评论。
Unfortunately it's known issue https://youtrack.jetbrains.com/issue/PY-14778, please follow it for updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
That is indeed unfortunate. Thank you for clarifying!