mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Rename the extension registry variables to have leading underscores --
this clarifies that they are part of an internal API (albeit shared between pickle.py, copy_reg.py and cPickle.c). I'd like to do the same for copy_reg.dispatch_table, but worry that it might be used by existing code. This risk doesn't exist for the extension registry.
This commit is contained in:
parent
322d553143
commit
d4b920c8bd
3 changed files with 29 additions and 29 deletions
|
@ -102,11 +102,11 @@ static PyObject *empty_tuple;
|
|||
static PyObject *dispatch_table;
|
||||
|
||||
/* For EXT[124] opcodes. */
|
||||
/* copy_reg.extension_registry, {(module_name, function_name): code} */
|
||||
/* copy_reg._extension_registry, {(module_name, function_name): code} */
|
||||
static PyObject *extension_registry;
|
||||
/* copy_reg.inverted_registry, {code: (module_name, function_name)} */
|
||||
/* copy_reg._inverted_registry, {code: (module_name, function_name)} */
|
||||
static PyObject *inverted_registry;
|
||||
/* copy_reg.extension_cache, {code: object} */
|
||||
/* copy_reg._extension_cache, {code: object} */
|
||||
static PyObject *extension_cache;
|
||||
|
||||
static PyObject *__class___str, *__getinitargs___str, *__dict___str,
|
||||
|
@ -5092,15 +5092,15 @@ init_stuff(PyObject *module_dict)
|
|||
if (!dispatch_table) return -1;
|
||||
|
||||
extension_registry = PyObject_GetAttrString(copy_reg,
|
||||
"extension_registry");
|
||||
"_extension_registry");
|
||||
if (!extension_registry) return -1;
|
||||
|
||||
inverted_registry = PyObject_GetAttrString(copy_reg,
|
||||
"inverted_registry");
|
||||
"_inverted_registry");
|
||||
if (!inverted_registry) return -1;
|
||||
|
||||
extension_cache = PyObject_GetAttrString(copy_reg,
|
||||
"extension_cache");
|
||||
"_extension_cache");
|
||||
if (!extension_cache) return -1;
|
||||
|
||||
Py_DECREF(copy_reg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue