Why doesn't Python go into more depth about errors?
I'm curious as to why Python doesn't list deeper errors? I am getting this error right now.
firms[i]['predmet_podnikania']=firms[i]['predmet_podnikania'][:-1]+[firms[i]['predmet_podnikania'][-1]+line]
IndexError: list index out of range
Ok, I understand that I am trying to access some list with a maximum index than the maximum one. But why doesn't Python say which one?
It could be: firms[i]
orfirms[i]['predmet_podnikania'][-1]
This will save you a lot of time.
+3
Milano slesarik
source
to share
1 answer
This exception is thrown in the class list
. There is no way to get the variable name ( firms
) inside methods list
so that the exception contains a generic message.
+4
Alik
source
to share