2

So it's been a long semester and I was writing my final project earlier today. I wrote a for loop which removed objects from the list it was iterating through. And my linter let me. Why do I even use you, pylint? I could have saved hours of debugging if you gave me a message that I was doing a stupid thing

Comments
  • 1
    Pretty sure linters aren't supposed to do that.
  • 0
    Pylint does a really good job of telling you when you're being stupid normally
  • 0
    @evandotjs except that deleting from a list is desired behavior a lot of the time
  • 0
    @beegC0de if you delete from a list in python during the iteration it'll skip over items because the indexes changed
  • 1
    Linters are good for syntactic or static errors. They really aren't meant for logical or symantic errors like yours.

    The linter can't know that skipping items because the index changed is undesirable THIS TIME because it may be what you actually wanted.
Add Comment