-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Introduce "type names" section to the style guide #1828
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
base: main
Are you sure you want to change the base?
Changes from all commits
8935bce
1328257
3c5e2c7
e0faa0c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,35 @@ of these entities are not assigned any special markup, but the preferred | |
| spellings are given in :ref:`specific words` to aid authors in maintaining the | ||
| consistency of presentation in the Python documentation. | ||
|
|
||
|
|
||
| Use simple language | ||
| =================== | ||
|
|
||
| Avoid esoteric phrasing where possible. Our audience is world-wide and may not | ||
| be native English speakers. | ||
|
|
||
| Don't use Latin abbreviations like "e.g." or "i.e." where English words will do, | ||
| such as "for example" or "that is." | ||
|
|
||
|
|
||
| Charged terminology to avoid | ||
| ============================ | ||
|
|
||
| Avoid terminology that may be considered insensitive or exclusionary. | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
|
|
||
| * - Avoid | ||
| - Instead | ||
| * - whitelist | ||
| - allowlist | ||
| * - blacklist | ||
| - blocklist, denylist | ||
| * - master/slave | ||
| - main, parent/child, server/client, primary/secondary | ||
|
|
||
|
|
||
| .. _specific words: | ||
|
|
||
| Specific words | ||
|
|
@@ -116,32 +145,25 @@ Unix | |
| 1970s. | ||
|
|
||
|
|
||
| Use simple language | ||
| =================== | ||
| Type names | ||
| ========== | ||
|
|
||
| Avoid esoteric phrasing where possible. Our audience is world-wide and may not | ||
| be native English speakers. | ||
|
|
||
| Don't use Latin abbreviations like "e.g." or "i.e." where English words will do, | ||
| such as "for example" or "that is." | ||
|
|
||
|
|
||
| Charged terminology to avoid | ||
| ============================ | ||
| When writing the names of types in prose, write the name of the type | ||
| exactly as it appears in source, styled as a class reference or an unlinked | ||
| class. For example, refer to dict as ``:class:`dict``` or ``:class:`!dict```. | ||
|
|
||
| Avoid terminology that may be considered insensitive or exclusionary. | ||
| Links should be used according to the :ref:`guidance on links <links>`. | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
| Some type names are commonly understood ideas or nouns outside of Python. | ||
| For example, "tuples" are a general programming concept, as distinct from the | ||
| ``tuple`` type. When referring to general ideas, do not style the relevant word | ||
| as a type. | ||
|
|
||
| * - Avoid | ||
| - Instead | ||
| * - whitelist | ||
| - allowlist | ||
| * - blacklist | ||
| - blocklist, denylist | ||
| * - master/slave | ||
| - main, parent/child, server/client, primary/secondary | ||
| Many types have descriptive names which do not exactly match their type | ||
| name. For example, "context variables" describes ``contextvars.ContextVar``, | ||
| and "partial function" may be used to describe an application of | ||
| ``functools.partial``. Use these names only when they serve to clarify the text | ||
| better than the type name itself would, and put them in lowercase. | ||
|
Comment on lines
+148
to
+166
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest moving this entry after the simple language one, and perhaps also after the charged terminology one as well.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the "Specific words" section above it also move? I thought it made sense to put these together, and I still do. What would you say to moving both of these? I could do it here (pragmatic and easy, but my least favorite way), do a precursor PR to move "Specific words" down, or do a follow-up PR.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving "Specific words" sounds okay to me, no preference whether in this PR or another.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do it here. I'm used to smaller projects with relatively much more review bandwidth per PR. I'm adjusting a bit for cpython and related projects. 🙂
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3c5e2c7 pushes them down, and as "proof" of my work making no other changes, the git diff selects the text which I did not cut-and-paste. I did introduce one extra newline, which seemed like it was missing for a section-break. |
||
|
|
||
|
|
||
| .. index:: diataxis | ||
|
|
@@ -190,6 +212,8 @@ Please consult the `Diátaxis <https://diataxis.fr/>`__ guide for more | |
| detail. | ||
|
|
||
|
|
||
| .. _links: | ||
|
|
||
| Links | ||
| ===== | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that link to the section title? I feel certain that this worked for me.
I just added an explicit anchor, on the assumption that I got confused and forgot how sphinx handles section-names.