This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Very confusing documenation for abc.Collections
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Sydney Pemberton, cheryl.sabella, docs@python, georg.brandl, iritkatriel, miss-islington, python-dev, rhettinger, thatiparthy
Priority: normal Keywords: patch

Created on 2020-06-16 19:14 by Sydney Pemberton, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Confusing docs.ipynb Sydney Pemberton, 2020-06-16 19:14 Jupyter notebook
Pull Requests
URL Status Linked Edit
PR 21880 merged python-dev, 2020-08-14 14:08
PR 21926 merged miss-islington, 2020-08-20 10:31
PR 21927 merged miss-islington, 2020-08-20 10:31
Messages (14)
msg371690 - (view) Author: Sydney Pemberton (Sydney Pemberton) * Date: 2020-06-16 19:14
I was writing a Jupyter notebook at the time, which I think perfectly illustrated the blind alley this documentation bug led me down before beating me up and stealing my lunch money.

I have come to this point in the documentation at least half a dozen times while learning Python and always left confused and with the sense that Python is more complicated than I had thought. 

Notebook attached. 

This documentation style violates two principles:
 - The implied structure of headings and content below it.
 - Many natural languages do not contain context-sensitive grammar and so using the "respectively" idiom can be very confusing for people who speak English as a second language.
msg375171 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-08-11 12:50
Can you be more specific about what you found confusing? What is the documentation bug? What do you mean by "this point in the documentation"?

Even better, can you suggest how to rewrite the documentation to make it clearer?
msg375202 - (view) Author: Sydney Pemberton (Sydney Pemberton) * Date: 2020-08-11 21:35
If you look at the Jupyter notebook it should be fairly clear but to
summarize here is the issue:

class collections.abc.Container
class collections.abc.Hashable
class collections.abc.Sized
class collections.abc.Callable
    ABCs for classes that provide respectively the
methods __contains__(), __hash__(), __len__(), and __call__().

This should become

class collections.abc.Container
    ABC for classes that provide the method __contains__().
class collections.abc.Hashable
     ABC for classes that provide the method __hash__().
class collections.abc.Sized
    ABC for classes that provide the method __len()__.
class collections.abc.Callable
    ABC for classes that provide the method __call__().
msg375325 - (view) Author: Srinivas Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) (thatiparthy) * Date: 2020-08-13 17:35
English is my second language and I am familiar with the expression “respectively” since it is used very often in high school mathematics.
msg375327 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-08-13 17:54
Sydney, is the issue related to how Jupyter notebook displays the documentation?
msg375338 - (view) Author: Sydney Pemberton (Sydney Pemberton) * Date: 2020-08-13 19:59
Nothing to do with Jupyter itself.
When I'm reading the documentation I don't necessarily think that a sibling
"node" in the document structure is going to have anything to do with my
current section.
So it was weird to see the section entirely empty.

Also, I'm not saying that all non-native speakers are going to be
unfamiliar with the construction, but it is certainly more widely
understandable if the definitions are kept separate.

On Thu, Aug 13, 2020 at 12:54 PM Irit Katriel <report@bugs.python.org>
wrote:

>
> Irit Katriel <iritkatriel@yahoo.com> added the comment:
>
> Sydney, is the issue related to how Jupyter notebook displays the
> documentation?
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue40994>
> _______________________________________
>

-- 

Sydney Pemberton

Software Engineer

512.740.6591

spemberton@auntbertha.com
Aunt Bertha <https://company.auntbertha.com/> | The Social Care Network
msg375370 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2020-08-14 05:05
FWIW, I think Sydney's right. Shared entries should only be used for closely related, or interdependent, APIs, which those here are not.
msg375377 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-08-14 08:22
Looks like this is not the first time this has come up: https://stackoverflow.com/questions/39789876/why-collections-callable-provides-contains-hash-len-and-ca

The link directly to the #collections.abc.Callable section is what makes it confusing: 

https://python.readthedocs.io/en/latest/library/collections.abc.html#collections.abc.Callable
msg375379 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-08-14 08:23
Sydney, do you want to create a PR for this? I'm happy to if you don't.
msg375402 - (view) Author: Sydney Pemberton (Sydney Pemberton) * Date: 2020-08-14 13:28
Yes, that would be great. I will figure out how to do that shortly.

On Fri, Aug 14, 2020 at 3:23 AM Irit Katriel <report@bugs.python.org> wrote:

>
> Irit Katriel <iritkatriel@yahoo.com> added the comment:
>
> Sydney, do you want to create a PR for this? I'm happy to if you don't.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue40994>
> _______________________________________
>

-- 

Sydney Pemberton

Software Engineer

512.740.6591

spemberton@auntbertha.com
Aunt Bertha <https://company.auntbertha.com/> | The Social Care Network
msg375697 - (view) Author: miss-islington (miss-islington) Date: 2020-08-20 10:30
New changeset 2ce39631f679e14132a54dc90ce764259d26e166 by Sydney Pemberton in branch 'master':
bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880)
https://github.com/python/cpython/commit/2ce39631f679e14132a54dc90ce764259d26e166
msg375701 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2020-08-20 11:17
@Sydney Pemberton, thank you for the bug report and for the PR!
msg375789 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2020-08-22 09:06
New changeset 0694b82381ff27e10bb15172da0832a7e65aaa2d by Miss Islington (bot) in branch '3.8':
bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880) (#21927)
https://github.com/python/cpython/commit/0694b82381ff27e10bb15172da0832a7e65aaa2d
msg375790 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2020-08-22 09:07
New changeset f497bbeed08e5a7f83adecf330b61fb88e9c3fa6 by Miss Islington (bot) in branch '3.9':
bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880) (#21926)
https://github.com/python/cpython/commit/f497bbeed08e5a7f83adecf330b61fb88e9c3fa6
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85166
2020-08-22 09:07:01cheryl.sabellasetmessages: + msg375790
2020-08-22 09:06:39cheryl.sabellasetmessages: + msg375789
2020-08-20 11:17:30cheryl.sabellasetstatus: open -> closed

type: enhancement

nosy: + cheryl.sabella
messages: + msg375701
resolution: fixed
stage: patch review -> resolved
2020-08-20 10:31:11miss-islingtonsetpull_requests: + pull_request21040
2020-08-20 10:31:02miss-islingtonsetpull_requests: + pull_request21039
2020-08-20 10:30:43miss-islingtonsetnosy: + miss-islington
messages: + msg375697
2020-08-17 18:32:08iritkatrielsetversions: + Python 3.9, Python 3.10
2020-08-14 14:08:50python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request21004
stage: patch review
2020-08-14 13:28:16Sydney Pembertonsetmessages: + msg375402
2020-08-14 08:23:50iritkatrielsetmessages: + msg375379
2020-08-14 08:22:19iritkatrielsetmessages: + msg375377
2020-08-14 05:05:10georg.brandlsetnosy: + georg.brandl
messages: + msg375370
2020-08-13 19:59:40Sydney Pembertonsetmessages: + msg375338
2020-08-13 17:54:20iritkatrielsetmessages: + msg375327
2020-08-13 17:35:45thatiparthysetnosy: + thatiparthy
messages: + msg375325
2020-08-11 21:35:35Sydney Pembertonsetmessages: + msg375202
2020-08-11 12:50:01iritkatrielsetnosy: + iritkatriel
messages: + msg375171
2020-06-17 01:30:33xtreaksetnosy: + rhettinger
2020-06-16 19:14:54Sydney Pembertoncreate