bpo-41521: Replace whitelist/blacklist with allowlist/denylist by vstinner · Pull Request #21824 · python/cpython
This change is backward incompatible, but test.support doesn't provide any backward compatibility warranty:
"The test package is meant for internal use by Python only."
https://docs.python.org/dev/library/test.html
At least, I wrote a NEWS entry to document the change.
Is denylist a good name? It does not deny anything. It is just a sequence of non-underscored names which are found in the module's dir(), but are absent in __all__. It is an opposite to the extra parameter. Maybe skip or exclude be better name?
I agree with Serhiy about denylist in this specific instance. Since the parameter intended to specify public-seeming names that should in fact be private, I would suggest a name such as keep_private would be most in keeping with the desired intent.
They are not necessary private. They are just not imported by star-import. For example from calendar import * does not add January and MONDAY to your globals, but calendar.January and calendar.MONDAY are public names.
dont_export: check__all__() function doesn't export anything. Maybe not_exported?
Is denylist a good name? It does not deny anything.
Well, nobody said that "blacklist" was a best term in the first place :-D
@serhiy-storchaka, @vsajip: What do you think of ignore or ignore_list name?
@vsajip: Ok, I modified my PR to use not_exported name instead. It's a better name than "blacklist".
@vsajip @serhiy-storchaka: Thank you for your reviews, "not_exported" is a better name than "denylist" (or "blacklist") ;-)
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request
xzy3 pushed a commit to xzy3/cpython that referenced this pull request