[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Eric V. Smith
Eric V. Smith added the comment: Unfortunately there's not much that can be done about this. The code that writes that error message only knows about objects, which don't have names, only types and values. -- ___ Python tracker

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Jason Schwefel
Jason Schwefel 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

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Closing as "not a bug". -- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Eric V. Smith
Eric V. Smith added the comment: I should point out that this is the same as doing: >>> ''() :1: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma? Traceback (most recent call last): File "", line 1, in TypeError: 'str' object is not callable Except for the

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Eric V. Smith
Eric V. Smith added the comment: You've rebound "int" to a string. I think the error message is correct. Here's a simpler case: >>> int = '' >>> int '' >>> int() Traceback (most recent call last): File "", line 1, in TypeError: 'str' object is not callable What do you expect to gain with

[issue42118] TypeError gives wrong reserved name

2020-10-22 Thread Jason Schwefel
New submission from Jason Schwefel : The following code gives a "TypeError: 'str' object is not callable" exception: int = '' s = '3500:day' a = s.split(':') i = int(a[0]) Proper exception message should be "TypeError: 'int' object is not callable" Only able to test on 3.8 and 3.9