diff options
author | Victor Stinner <vstinner@python.org> | 2020-08-11 13:26:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 13:26:59 (GMT) |
commit | fabd7bb8e0450f16ed5c5c0ad575aa413d65712d (patch) | |
tree | 697881ab8dd38a990ebd68a018a20f08c2ab3c67 /Objects | |
parent | 1d541c25c8019f7a0b80b3e1b437abe171e40b65 (diff) | |
download | cpython-fabd7bb8e0450f16ed5c5c0ad575aa413d65712d.zip cpython-fabd7bb8e0450f16ed5c5c0ad575aa413d65712d.tar.gz cpython-fabd7bb8e0450f16ed5c5c0ad575aa413d65712d.tar.bz2 |
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)
Automerge-Triggered-By: @tiran
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 49b3c85..c66f8fc 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4171,10 +4171,10 @@ object_set_class(PyObject *self, PyObject *value, void *closure) In theory the proper fix would be to identify which classes rely on this invariant and somehow disallow __class__ assignment only for them, perhaps via some mechanism like a new Py_TPFLAGS_IMMUTABLE flag (a - "blacklisting" approach). But in practice, since this problem wasn't + "denylisting" approach). But in practice, since this problem wasn't noticed late in the 3.5 RC cycle, we're taking the conservative approach and reinstating the same HEAPTYPE->HEAPTYPE check that we used - to have, plus a "whitelist". For now, the whitelist consists only of + to have, plus an "allowlist". For now, the allowlist consists only of ModuleType subtypes, since those are the cases that motivated the patch in the first place -- see https://bugs.python.org/issue22986 -- and since module objects are mutable we can be sure that they are |