Skip to content

Commit de0c690

Browse files
authored
Merge pull request #524 from eriknw/inclusive_language
Replace blacklist/whitelist with denylist/allowlist
2 parents 5d3b61f + 28620de commit de0c690

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,24 @@ jobs:
3030
coverage run -m pytest --doctest-modules toolz/
3131
pytest bench/
3232
pep8 --ignore="E731,W503,E402" --exclude=conf.py,tests,examples,bench -r --show-source .
33-
- name: Coverate
33+
- name: Coverage
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.github_token }}
36+
COVERALLS_FLAG_NAME: ${{ matrix.python-version}}
37+
COVERALLS_PARALLEL: true
3438
if: (! contains(matrix.python-version, 'pypy'))
3539
run: |
3640
coverage report --show-missing --fail-under=100
41+
pip install coveralls
42+
coverage report --show-missing
43+
coveralls --service=github
44+
45+
finish:
46+
needs: test
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Coveralls Finished
50+
uses: coverallsapp/github-action@master
51+
with:
52+
github-token: ${{ secrets.github_token }}
53+
parallel-finished: true

doc/source/tips-and-tricks.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ a part of toolz's standard offerings. This section presents
66
a few of these recipes.
77

88

9-
* .. function:: pick(whitelist, dictionary)
9+
* .. function:: pick(allowlist, dictionary)
1010

1111
Return a subset of the provided dictionary with keys contained in the
12-
whitelist.
12+
allowlist.
1313

1414
::
1515

1616
from toolz import keyfilter
1717

18-
def pick(whitelist, d):
19-
return keyfilter(lambda k: k in whitelist, d)
18+
def pick(allowlist, d):
19+
return keyfilter(lambda k: k in allowlist, d)
2020

2121

2222
Example:
@@ -26,17 +26,17 @@ a few of these recipes.
2626
{'a': 1, 'b': 2}
2727

2828

29-
* .. function:: omit(blacklist, dictionary)
29+
* .. function:: omit(denylist, dictionary)
3030

3131
Return a subset of the provided dictionary with keys *not* contained in the
32-
blacklist.
32+
denylist.
3333

3434
::
3535

3636
from toolz import keyfilter
3737

38-
def omit(blacklist, d):
39-
return keyfilter(lambda k: k not in blacklist, d)
38+
def omit(denylist, d):
39+
return keyfilter(lambda k: k not in denylist, d)
4040

4141

4242
Example:

toolz/tests/test_inspect_args.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,16 +386,16 @@ def test_introspect_builtin_modules():
386386
mods = [builtins, functools, itertools, operator, toolz,
387387
toolz.functoolz, toolz.itertoolz, toolz.dicttoolz, toolz.recipes]
388388

389-
blacklist = set()
389+
denylist = set()
390390

391-
def add_blacklist(mod, attr):
391+
def add_denylist(mod, attr):
392392
if hasattr(mod, attr):
393-
blacklist.add(getattr(mod, attr))
393+
denylist.add(getattr(mod, attr))
394394

395-
add_blacklist(builtins, 'basestring')
396-
add_blacklist(builtins, 'NoneType')
397-
add_blacklist(builtins, '__metaclass__')
398-
add_blacklist(builtins, 'sequenceiterator')
395+
add_denylist(builtins, 'basestring')
396+
add_denylist(builtins, 'NoneType')
397+
add_denylist(builtins, '__metaclass__')
398+
add_denylist(builtins, 'sequenceiterator')
399399

400400
def is_missing(modname, name, func):
401401
if name.startswith('_') and not name.startswith('__'):
@@ -412,7 +412,7 @@ def is_missing(modname, name, func):
412412
and func.__module__ is not None
413413
and modname in func.__module__
414414
and is_partial_args(func, (), {}) is not True
415-
and func not in blacklist)
415+
and func not in denylist)
416416
except AttributeError:
417417
return False
418418

0 commit comments

Comments
 (0)