Pycharm highlights ".keys()" on line 5 and gives me following warning for it for this illustrative code:
1 def testfunc():
2 mydic = {}
3 for x in range(5):
4 mydic[x] = str(x)
5 elems = set(mydic.keys())
Python Interpretor: python2.7 from anaconda. Pycharm v2017.3
Can someone help me understand why do I get this warning? Everything works as expected.
Screenshots:
As per user2235698's comment above and based on my verification, this is because of a buggy pycharm version. Please update your pycharm.
I've had this bug in PyCharm 2019.3 too. The problem was that the virtualenv I used was not excluded.
More details: https://youtrack.jetbrains.com/issue/PY-34943
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With