Skip to main content
2 of 4
added 276 characters in body
TigerhawkT3
  • 49.3k
  • 1
  • 24
  • 32

Yes, "str object is not callable" is a very common error. Sometimes the asker has masked the str() function by calling their string str. Sometimes they're just adding parentheses after a string for no apparent reason. A quick Google of site:stackoverflow.com python str not callable (I do this a lot; Google sometimes asks me if I'm sure I'm not a robot) seems to focus mostly on those two reasons. People who ask this question probably could have done a bit more research. However, they do not. Why, you ask? Fortunately, I have the following infographic for you:

useful infographic

Most useful programming knowledge is on SO. That's why SO is so popular: if you're wondering something about how to program, you can probably find it here. It's great. Just the other day I found a delightful little snippet about how to add a tooltip to a widget in Tkinter with nothing but an import of an included library and a simple tip = Tip(widget, text) (oddly, a Tkinter question with no answer from Bryan Tcl/Tk Oakley :P).

But how about that other circle, the one I labeled as "crap" and colored an ominous brown? That is the bulk of Stack Overflow: the incredible mountain of Big Data delivered unto us by the 99% of programmers who don't know how to research any more than they know how to program. Sometimes they are not even programmers - they are professionals from other fields who stumbled upon an article claiming that "R is an excellent language for data analysis" or "Python is making a big splash in bioinformatics" and then dove into the deep end (either of their own volition or after their manager made it a priority zero key ask). Professionals or not, they still don't understand that you have to learn a language before using it, whether it's a human language or a programming language. It seems so simple at first: learn the magic words, write them, and it works.

Except when it doesn't. Then, instead of figuring "I better go back and learn this before using it," it seems much faster to ask someone to take a glance at the magic words. And whom shall they ask? I'll give you a hint: us. This is the crap, and it is flowing inexorably into SO via osmosis and laziness. We cannot stop it. All we can do is bail as fast as we can, tossing these questions into the duplicate pile, closing as too broad, closing as "off-topic for SO because this is your homework, not mine, and I don't care that you let it sit on your desk for a week and it's due tomorrow, I'm still not doing it for you," and answering for 2-3 points.

Note how the last option - answering questions - is the only way to get rep (past the couple thousand for approved edits), and further note how most of everything is crap. Logically, then, the most reliable way to boost your reputation on SO as a programming wizard is to answer crap and duplicates (I occasionally dupehammer questions after they've already been answered, and the person who answered the question I just closed is the same one who answered the canonical duplicate), because if you wait for gems you will be old and gray before you get anywhere on this site. This hasn't always been the case - after all, the very first person to post stupid question X wasn't asking such a stupid question, at least in terms of SO. Maybe the information they needed was easily available elsewhere (e.g., the change from print statement in Python 2 to print() function in Python 3 was available in the release notes, along with many less-visible changes), but it wasn't yet easily available on SO per se.

Direct answers to your specific questions:

  1. What to do? - Find a duplicate if possible. If none exists, answer the question to broaden the duplicate pool.
  2. Should I write my own canonical QA and crush all other similar questions in my path? - Sure, as long as your canonical effort is appropriate and relevant to each question you hammer.
  3. Which duplicate should I pick? - The one that'll cause the least argument. Generally I look for highly-upvoted answers, with the "correct" one for the topic at hand being the top answer on that question (answers past the first do not exist). Be prepared for nonsense like "but the string that question is trying to call is named example, while the string this question is trying to call is named test! It's not a duplicate at all! Who made you a moderator on this forum!?" Instead of getting a headache, close the tab and move on with your life.
  4. Should I make edits? - If you're making it better, sure. If not, then no. It doesn't matter in the slightest that your motivation is frustration at the lack of a canonical question. If improving it for your purposes makes it better, go ahead. I wouldn't edit a "put () after a string for no reason" question to also have something about str = 'hello', but if you want to add something about "you may also run into this error if you mask str()" to an answer, that seems fine to me.

Help vampires and rep whores are an integral part of SO these days. Even mods take part in it, while links to resources are treated with disdain.

TL;DR: As the VP of R&D at my old company would say in his heavy Middle-Eastern accent, "it is crap." But it's okay.

TigerhawkT3
  • 49.3k
  • 1
  • 24
  • 32