classification
Title: Replace whitelist/blacklist with allowlist/denylist
Type: Stage: resolved
Components: Documentation, Library (Lib) Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: christian.heimes, docs@python, lukasz.langa, miss-islington, rhettinger, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2020-08-11 12:44 by vstinner, last changed 2020-08-17 05:23 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 21822 merged vstinner, 2020-08-11 12:47
PR 21823 merged vstinner, 2020-08-11 12:49
PR 21824 merged vstinner, 2020-08-11 12:57
PR 21825 merged vstinner, 2020-08-11 13:08
PR 21826 merged vstinner, 2020-08-11 13:37
Messages (14)
msg375170 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-11 12:44
I propose to replace whitelist/blacklist with allowlist/denylist. The terms whitelist and blacklist can be associated to color skins which isn't the intent. To avoid confusion, I propose to use neutral terms: allowlist and denylist. Moreover, as a french person (english is not my first language, but french), "allow" and "deny" are even more explicit to me than "white "and "black".

The intent is to make the Python community more welcoming and more diverse by avoiding to make some people uncomfortable.

Many other projects already replaced whitelist/blacklist with allowlist/denylist:

* GitLab: https://gitlab.com/gitlab-org/gitlab/-/issues/7554
* React: https://github.com/facebook/react/commit/8a8d973d3cc5623676a84f87af66ef9259c3937c
* Mediawiki: https://phabricator.wikimedia.org/T254646
* GitHub: https://thenextweb.com/dd/2020/06/15/github-plans-to-replace-racially-insensitive-terms-like-master-and-whitelist/
* Google Chrome: https://9to5google.com/2020/06/12/google-android-chrome-blacklist-blocklist-more-inclusive/
* etc.

See also:

* Carolyn Stransky's "Humanizing Your Documentation" presentation:
https://speakerdeck.com/carolstran/humanizing-your-documentation-full-talk
* bpo-34605: "Avoid master/slave terminology"

Attached PRs replace whitelist/blacklist with allowlist/denylist.
msg375172 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2020-08-11 12:52
+1
msg375173 - (view) Author: miss-islington (miss-islington) Date: 2020-08-11 13:27
New changeset fabd7bb8e0450f16ed5c5c0ad575aa413d65712d by Victor Stinner in branch 'master':
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)
https://github.com/python/cpython/commit/fabd7bb8e0450f16ed5c5c0ad575aa413d65712d
msg375174 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-11 13:28
New changeset 0ee0b2938cb606151d8d287472c838044bad4a0e by Victor Stinner in branch 'master':
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21823)
https://github.com/python/cpython/commit/0ee0b2938cb606151d8d287472c838044bad4a0e
msg375175 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-11 14:19
"While the etymology of the words isn't steeped in racial undertones or history like other problematic tech word choices, there is no harm in changing them to synonyms that as just as understandable and avoid the question entirely"

https://web.archive.org/web/20180921225759/https://github.com/facebook/react/issues/13604#issuecomment-419884422
msg375176 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-11 14:24
Another rationale from "Inclusive Chromium code":

Terms such as “blacklist” and “whitelist” reinforce the notion that black==bad and white==good. That Word Black, by Langston Hughes illustrates this problem in a lighthearted, if somewhat pointed way. These terms can usually be replaced by “blocklist” and “allowlist” without changing their meanings, but particular instances may need other replacements.

https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md
msg375209 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-08-12 05:47
Should not such changes be widely discussed on the Python-Dev mailing list before merging?
msg375217 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2020-08-12 08:53
New changeset 0e95bbf08571e98f4b688524efc2dcf20d315d91 by Victor Stinner in branch 'master':
bpo-41521, typing: Rename _PROTO_WHITELIST to _PROTO_ALLOWLIST (#21825)
https://github.com/python/cpython/commit/0e95bbf08571e98f4b688524efc2dcf20d315d91
msg375218 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-12 09:54
Serhiy:
> Should not such changes be widely discussed on the Python-Dev mailing list before merging?

I would prefer avoiding python-dev, since there are many trolls there who like to argue but not try to fix problem. See the recent discussion about the PEP 8 commit message for example.

I opened https://github.com/python/devguide/issues/605 to define general guidelines about terminology.
msg375323 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-13 17:20
New changeset 20ae565bd2d79425d5567c001ed8f89848d7d907 by Victor Stinner in branch 'master':
bpo-41521: Replace denylist with blocklist is http.cookiejar doc (GH-21826)
https://github.com/python/cpython/commit/20ae565bd2d79425d5567c001ed8f89848d7d907
msg375421 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-08-14 17:52
> I would prefer avoiding python-dev, since there are many 
> trolls there who like to argue but not try to fix problem.

It's not a good precedent to define as trolls anyone who might legitimately disagree, nor is it a good precedent to bypass discussion entirely. IMO, Serhiy's request was reasonable and shouldn't be dismissed.

For this particular change, I'm +1 because it represents an industrywide terminology shift, because it makes a proactive effort to be responsive to cultural problems, and because the change doesn't impair clarity.  

That said, I concur with Serhiy that there should be a discussion before making a unilateral and stealthy change to the rules about how people are allowed to write technical prose.
msg375432 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-14 21:05
> That said, I concur with Serhiy that there should be a discussion before making a unilateral and stealthy change to the rules about how people are allowed to write technical prose.

I suggest you to join the discussion there:
https://github.com/python/devguide/issues/605
msg375525 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-17 05:20
New changeset fbf43f051e7bf479709e122efa4b6edd4b09d4df by Victor Stinner in branch 'master':
bpo-41521: Rename blacklist parameter to not_exported (GH-21824)
https://github.com/python/cpython/commit/fbf43f051e7bf479709e122efa4b6edd4b09d4df
msg375526 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-08-17 05:23
I don't think that it's worth it to backport these changes, so I close the issue.

Again, to avoid reintroducing such terms, I proposed https://github.com/python/devguide/issues/605 to define some general guidelines on the terminology.

Thanks for reviews.
History
Date User Action Args
2020-08-17 05:23:44vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg375526

stage: patch review -> resolved
2020-08-17 05:20:49vstinnersetmessages: + msg375525
2020-08-14 21:05:36vstinnersetmessages: + msg375432
2020-08-14 17:52:20rhettingersetnosy: + rhettinger
messages: + msg375421
2020-08-13 17:20:35vstinnersetmessages: + msg375323
2020-08-12 09:54:27vstinnersetmessages: + msg375218
2020-08-12 08:53:24lukasz.langasetnosy: + lukasz.langa
messages: + msg375217
2020-08-12 05:47:58serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg375209
2020-08-11 14:24:23vstinnersetmessages: + msg375176
2020-08-11 14:19:49vstinnersetmessages: + msg375175
2020-08-11 13:37:31vstinnersetpull_requests: + pull_request20955
2020-08-11 13:28:50vstinnersetmessages: + msg375174
2020-08-11 13:27:07miss-islingtonsetnosy: + miss-islington
messages: + msg375173
2020-08-11 13:08:52vstinnersetpull_requests: + pull_request20954
2020-08-11 12:57:38vstinnersetpull_requests: + pull_request20953
2020-08-11 12:52:23christian.heimessetnosy: + christian.heimes
messages: + msg375172
2020-08-11 12:49:05vstinnersetpull_requests: + pull_request20952
2020-08-11 12:47:27vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request20951
2020-08-11 12:44:30vstinnercreate