-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Search is not beginner friendly #87780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A commonly asked question on Quora is 'What do *args and **kwargs' mean ? While it is relatively easy for community to answer these questions the search tool on the standard documentation doesn't make it easy. I understand that 'args' and 'kwargs' are both naming conventions, they are very common across the documentation, but searching on '*args' or '**kwargs' doesn't actually find anything useful - it certainly doesn't place 'https://docs.python.org/3/tutorial/controlflow.html#arbitrary-argument-lists' at or close to the top of the list. It is my view that the documentation should be beginner friendly, but in this case (and many other I guess) you have to know what to search for to find something useful. I note that even common phrases in Computing (such as 'variable arguments' or 'variable parameters') don't find anything useful. The term 'variadic' does find the relevant page, but the link displayed in the search results lands on the page (but not the relevant section) - and many beginners wont search for 'variadic'. The index and search need to be improved to help beginners - specifically in this case
|
Ha! I just was going to open the same issue (perhaps we read the same post on Quora). I concur that it is perhaps worth to add index entries for common parameter names (args, kwargs, self, cls) and also for *args and **kwargs and add notions that such name is commonly used for such parameter. |
Just a little update to this, now that bpo-34398 is fixed it is possible to make this more beginner friendly by making sure the right terms have glossary entries. As an example, here is a search for "argument" on the latest docs: https://docs.python.org/3.10/search.html?q=argument It would be nice if kwargs/args could also point to that. |
If this just involves adding glossary entries for some common terms, I can try to take a look at this soon-ish, since this is high-impact but should be fairly straightforward to accomplish. We should compile a list of relevant entries to add. Here are those mentioned here:
I'm there there are others; one thing I believe Guido mentioned elsewhere was |
No, I do not think that we need glossary entries for these words. There are already entries for It would be nice if search work for Python operators and other syntax elements that are present in the index: |
Ah, good point, thanks—we wouldn't want to duplicate that then, just make it easier to find, since the peculiar terms "var-positional" and "var-keyword" for these aren't used anywhere else I could find in the docs, nor in general usage (such that I missed them myself). While we could just add stub terms that point back to the main term as is done for positional and keyword argument, this requires readers to jump an extra step, and still doesn't point to the specific part of the parameter entry it refers to (which is the longest in the glossary and takes up a full screen when searching), which may lead to confusion and ambiguity. Likewise, we could just add multiple terms to the same existing entry, but this would overload the term list and doesn't fix the main problems (length and ambiguity). Instead, we should split the bullets for positional-only, keyword-only, positional variadic and keyword variadic parameters into their own entries that have their respective aliases as additional terms, and cross-linking the main entry to the sub-entries and vice versa. Then, searching for That does leave
See sphinx-doc/sphinx#6692 ; @AA-Turner is working on it for Sphinx 5.2.0 🎉 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: