summaryrefslogtreecommitdiffstats
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-02-04 01:54:49 (GMT)
committerGuido van Rossum <guido@python.org>2003-02-04 01:54:49 (GMT)
commitd4b920c8bd2d41b49d30c89fe9732ff443fe71f8 (patch)
tree0cf3efd4ca829c91aa1b2386c6dbc1407622b493 /Lib/pickle.py
parent322d553143b464ffa9b72105927469279cf3c31a (diff)
downloadcpython-d4b920c8bd2d41b49d30c89fe9732ff443fe71f8.zip
cpython-d4b920c8bd2d41b49d30c89fe9732ff443fe71f8.tar.gz
cpython-d4b920c8bd2d41b49d30c89fe9732ff443fe71f8.tar.bz2
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.
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 870d94d..35ab91b 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -28,7 +28,7 @@ __version__ = "$Revision$" # Code version
from types import *
from copy_reg import dispatch_table, _reconstructor
-from copy_reg import extension_registry, inverted_registry, extension_cache
+from copy_reg import _extension_registry, _inverted_registry, _extension_cache
import marshal
import sys
import struct
@@ -845,7 +845,7 @@ class Pickler:
(obj, module, name))
if self.proto >= 2:
- code = extension_registry.get((module, name))
+ code = _extension_registry.get((module, name))
if code:
assert code > 0
if code <= 0xff:
@@ -1238,15 +1238,15 @@ class Unpickler:
def get_extension(self, code):
nil = []
- obj = extension_cache.get(code, nil)
+ obj = _extension_cache.get(code, nil)
if obj is not nil:
self.append(obj)
return
- key = inverted_registry.get(code)
+ key = _inverted_registry.get(code)
if not key:
raise ValueError("unregistered extension code %d" % code)
obj = self.find_class(*key)
- extension_cache[code] = obj
+ _extension_cache[code] = obj
self.append(obj)
def find_class(self, module, name):