List __getitem__ warning Follow
The following example code produces the IDE warning below:
result = list()
result.append(1)
result.append(result[-1])
Class 'list' does not define '__getitem__', so the '[]' operator cannot be used on its instances
It doesn't produce the warning if I use:
result = []
Please sign in to leave a comment.
Hello,
This is a bug, please vote for https://youtrack.jetbrains.com/issue/PY-50414/Incorrect-warning-Class-list-does-not-define-getitem-so-the-operator-cannot-be-used-on-its-instances in order to increase its priority and be notified about resolution.
My apologies for the inconvenience.
Thanks Antonina,
I'll have a look at that link.
Cheers Troy