Python: ‘str’ obj is not callable

Self-tutoring about Python: the tutor mentions an error he encountered.

I ran across TypeError: ‘str’ obj is not callable in the repl when testing a class. It happened when I tried something like str(Obj), which should work.

Yet, it won’t work if there’s a variable with str as its name. I tried del str, then tried str(Obj) again: it worked.

Source:

dev2qa.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply