[issue42118] TypeError gives wrong reserved name

Jason Schwefel report at bugs.python.org
Thu Oct 22 14:51:42 EDT 2020


Jason Schwefel <jason.schwefel78 at gmail.com> added the comment:

>What do you expect to gain with the "int = ''" statement?

I did not expect anything. I made a mistake in my initial code and the error message indicated that I rebound 'str'. I could not find where I had used 'str' as a variable name. If it would have said 'int', as that was the function that I rebound as a variable name, I would have immediately known what to look for.

I understand that it is mostly cosmetic, but I am sure I am not the first person that went down the wrong path because of this. 

I understand that I was using the variable named 'int' as a string and therefore referencing it as 'str' object is technically correct. However, I am still relatively new to Python, as many others are, and the the error message could be a bit more clear.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42118>
_______________________________________


More information about the Python-bugs-list mailing list