df = dataframe.DataFrame([["cat", datetime.datetime(year=2021, month=1, day=23)],
["cat", datetime.datetime(year=2021, month=5, day=19)]
["dog", datetime.datetime(year=2021, month=7, day=4)]],
columns=["animal","when"])
This code is missing a comma at the end of the second line. This leads to the following error message:
Traceback (most recent call last):
.star:25:2: in <toplevel>
.star:7:29: in f
Error: list index: got tuple, want int
We can detect this situation, and wrap the error so it displays this:
Error: list index: got tuple, want int (did you miss a trailing comma?)
This code is missing a comma at the end of the second line. This leads to the following error message:
We can detect this situation, and wrap the error so it displays this: