summaryrefslogtreecommitdiffstats
path: root/Lib/copy_reg.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
committerGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
commit45aecf451a64fb1ebe5e74d0b00965ac8d99dff6 (patch)
treea7edcfb45ceafcffde68a3542aeba67089ea81cb /Lib/copy_reg.py
parentf3175f6341ae207543a0d2d3be36c457349066e6 (diff)
downloadcpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.zip
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.gz
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.bz2
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done) - int/int -> float - all exceptions must derive from BaseException - absolute import - 'as' and 'with' are keywords
Diffstat (limited to 'Lib/copy_reg.py')
-rw-r--r--Lib/copy_reg.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/Lib/copy_reg.py b/Lib/copy_reg.py
index f499013..169520d 100644
--- a/Lib/copy_reg.py
+++ b/Lib/copy_reg.py
@@ -4,17 +4,12 @@ This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
-from types import ClassType as _ClassType
-
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_type, pickle_function, constructor_ob=None):
- if type(ob_type) is _ClassType:
- raise TypeError("copy_reg is not intended for use with classes")
-
if not callable(pickle_function):
raise TypeError("reduction functions must be callable")
dispatch_table[ob_type] = pickle_function