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)
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?
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.
The the first page of results are from, in order:
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)