mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)
Automerge-Triggered-By: @tiran
This commit is contained in:
parent
1d541c25c8
commit
fabd7bb8e0
12 changed files with 36 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue