30
uuid
6y

I never had problems with punctuation marks during coding, especially the notorious semicolons because I've always used an IDE, ain't gotta time to waste on compiler errors.

But today I meet my nemesis, a fucking comma wasted an hour of my precious time, causing my unit tests to fail in Python, my unit tests where expecting a list and the actual value is a tuple, it turned out that there was this trailing comma - which I don't know where the hell it came from - at the end of a function call that returns a list.

I only noticed this freaking comma after Pycharm indicated a conflict between the returned type and the expected type and underlined the culprit, that small invisible fucker 😬.

Thank you Pycharm and type hints in Python 3.

this is why, my fellow devs, you have to use an IDE.

PS: For those of you who aren't familiar with python, a trailing comma at end of a variable turns it into a one element tuple.

1, = (1,)

Comments
  • 0
    Use an IDE or use a text editor of your choice with linting/syntax plugins, all good :)
Add Comment