Skip to content

Commit fc66ade

Browse files
author
georg.brandl
committed
Revert copy_reg -> copyreg rename.
git-svn-id: http://svn.python.org/projects/python/trunk@63493 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 78bd928 commit fc66ade

23 files changed

Lines changed: 83 additions & 94 deletions

Doc/library/copy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ of lists by assigning a slice of the entire list, for example,
6363

6464
Classes can use the same interfaces to control copying that they use to control
6565
pickling. See the description of module :mod:`pickle` for information on these
66-
methods. The :mod:`copy` module does not use the :mod:`copyreg` registration
66+
methods. The :mod:`copy` module does not use the :mod:`copy_reg` registration
6767
module.
6868

6969
.. index::
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
:mod:`copyreg` --- Register :mod:`pickle` support functions
2-
===========================================================
1+
:mod:`copy_reg` --- Register :mod:`pickle` support functions
2+
============================================================
33

44
.. module:: copy_reg
5-
:synopsis: Old name for the copyreg module.
6-
7-
.. module:: copyreg
85
:synopsis: Register pickle support functions.
96

107
.. note::
118
The :mod:`copy_reg` module has been renamed to :mod:`copyreg` in Python 3.0.
12-
It is importable under both names in Python 2.6 and the rest of the 2.x
13-
series.
9+
The :term:`2to3` tool will automatically adapt imports when converting your
10+
sources to 3.0.
1411

1512
.. index::
1613
module: pickle
1714
module: cPickle
1815
module: copy
1916

20-
The :mod:`copyreg` module provides support for the :mod:`pickle` and
17+
The :mod:`copy_reg` module provides support for the :mod:`pickle` and
2118
:mod:`cPickle` modules. The :mod:`copy` module is likely to use this in the
2219
future as well. It provides configuration information about object constructors
2320
which are not classes. Such constructors may be factory functions or class

Doc/library/modulefinder.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Sample output (may vary depending on the architecture)::
9797

9898
Loaded modules:
9999
_types:
100-
copyreg: _inverted_registry,_slotnames,__all__
100+
copy_reg: _inverted_registry,_slotnames,__all__
101101
sre_compile: isstring,_sre,_optimize_unicode
102102
_sre:
103103
sre_constants: REPEAT_ONE,makedict,AT_END_LINE

Doc/library/persistence.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The list of modules described in this chapter is:
1919
.. toctree::
2020

2121
pickle.rst
22-
copyreg.rst
22+
copy_reg.rst
2323
shelve.rst
2424
marshal.rst
2525
anydbm.rst

Doc/library/pickle.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ not :meth:`__reduce_ex__`, the :meth:`__reduce_ex__` implementation detects this
535535
and calls :meth:`__reduce__`.
536536

537537
An alternative to implementing a :meth:`__reduce__` method on the object to be
538-
pickled, is to register the callable with the :mod:`copyreg` module. This
538+
pickled, is to register the callable with the :mod:`copy_reg` module. This
539539
module provides a way for programs to register "reduction functions" and
540540
constructors for user-defined types. Reduction functions have the same
541541
semantics and interface as the :meth:`__reduce__` method described above, except
@@ -786,7 +786,7 @@ the same process or a new process. ::
786786

787787
.. seealso::
788788

789-
Module :mod:`copyreg`
789+
Module :mod:`copy_reg`
790790
Pickle interface constructor registration for extension types.
791791

792792
Module :mod:`shelve`

Lib/copy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class instances).
4949
"""
5050

5151
import types
52-
from copyreg import dispatch_table
52+
from copy_reg import dispatch_table
5353

5454
class Error(Exception):
5555
pass

Lib/copyreg.py renamed to Lib/copy_reg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
def pickle(ob_type, pickle_function, constructor_ob=None):
1515
if type(ob_type) is _ClassType:
16-
raise TypeError("copyreg is not intended for use with classes")
16+
raise TypeError("copy_reg is not intended for use with classes")
1717

1818
if not hasattr(pickle_function, '__call__'):
1919
raise TypeError("reduction functions must be callable")

Lib/idlelib/rpc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import threading
3838
import queue
3939
import traceback
40-
import copyreg
40+
import copy_reg
4141
import types
4242
import marshal
4343

@@ -60,8 +60,8 @@ def pickle_code(co):
6060
# assert isinstance(fn, type.FunctionType)
6161
# return repr(fn)
6262

63-
copyreg.pickle(types.CodeType, pickle_code, unpickle_code)
64-
# copyreg.pickle(types.FunctionType, pickle_function, unpickle_function)
63+
copy_reg.pickle(types.CodeType, pickle_code, unpickle_code)
64+
# copy_reg.pickle(types.FunctionType, pickle_function, unpickle_function)
6565

6666
BUFSIZE = 8*1024
6767
LOCALHOST = '127.0.0.1'

Lib/lib-old/copy_reg.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

Lib/os.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def popen4(cmd, mode="t", bufsize=-1):
715715
return p.stdin, p.stdout
716716
__all__.append("popen4")
717717

718-
import copyreg as _copy_reg
718+
import copy_reg as _copy_reg
719719

720720
def _make_stat_result(tup, dict):
721721
return stat_result(tup, dict)

0 commit comments

Comments
 (0)