Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Search "python __init__" (sans quotes)

The the first page of results are from, in order:

    mygreatlearning.com
    udacity.com
    geeksforgeeks.org
    stackoverflow.com
    w3schools.com
    micropyramid.com
    edureka.co
    pythonmorsels.com
    tutorialspoint.com
    pythontutorial.net
Some of these resources are alright, but none of them are python.org or other primary source. As a python user and google expert, I know how to tweak my query to get better results, but if I was a novice I wouldn't.

On the other hand, if I went to the python community discord server, I'd probably get a sensible response from a real human in seconds. (the python discord is particularly excellent, by the way)



Surprising, the same search on duckduckgo gives me:

  www.w3schools.com  
  stackoverflow.com  
  docs.python.org
and a sidebar quoting the 2nd result which is the top voted answer to: "What is __init__.py for" on Stackoverflow.

Google is in a sad state it seems.


Google has a vested interest in you going to websites that serve their ads.


But why would a novice care if it came from python.org, providing the information was accurate? I don't think you've found a good example of what the GP was asking for, at any rate. I've certainly had that experience recently, but it turns out it was something more obscure than I would have expected (relating to ensuring that gulp scripts don't return an error code when warnings occur - I'd searched for `gulp --warnoff` and none of the answers were anything to do with the gulp tool, but it turned out "--warnoff" wasn't a standard flag anyway, though there is a blog post about how to add support for such a flag).


It doesn't seem like python.org answers the question very well? As in the implied question of "What is python __init__?"

The returned sites do?

If I google "php __construct" I get php documentation as the first result.

Google knows when someone doesn't find the answer they're looking for from a result, I suspect the results you're seeing are the ones the majority of searchers for that query wanted.


> The instantiation operation (“calling” a class object) creates an empty object. Many classes like to create objects with instances customized to a specific initial state. Therefore a class may define a special method named __init__(), like this:

  def __init__(self):
      self.data = []
> When a class defines an __init__() method, class instantiation automatically invokes __init__() for the newly created class instance. So in this example, a new, initialized instance can be obtained by:

  x = MyClass()
Seems like a good explanation to me? Maybe people are upset that it's buried a bit in the docs instead of having a tiny out of context statement about it?

[0]: https://docs.python.org/3/tutorial/classes.html


Yes, I suspect people saw a wall of text and went back to look for a shorter answer.

I would guess google A/B tested those results till python.org fell off the front page.

More to the point, I don't think either google or the people searching are wrong for that. The query isn't "teach me about python classes" it's "what is python __init__?".


Yea, I used to get annoyed when I saw results like this. But I appreciate them more and more. It's still easy to find what you're looking for with a quick Ctrl+F. But there inevitably comes a time when I want to understand a concept deeper, and I can come back to results like this for the longer explanation.

I know that it doesn't have to be either a long explanation or a quick and concise snippet of information, it can be both. But I find that a lot of docs will either have long explanations or short snippets (because time is finite and doing both is duplicating efforts), and in those cases, I prefer the long explanation.


Thats not what I mean by using a search engine to parse documentation. I would just type “python documentation” where the first link I get is the documentation. Then I would search within that documentation for “ __init__” which, when tested just now, took me about 30 seconds all in to get to the known good source of truth here. That’s pretty good I think.


geeksforgeeks.org is really dark pattern-y, and has been extremely high ranking for python related questions that seemed to come out of nowhere.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: