Rename copy_reg module to copyreg. · pythoncapi/cpython@f7fa63d · GitHub
Skip to content

Commit f7fa63d

Browse files
committed
Rename copy_reg module to copyreg.
Updated documentation. Merged revisions 63042 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r63042 | alexandre.vassalotti | 2008-05-11 04:25:28 -0400 (Sun, 11 May 2008) | 5 lines Added module stub for copy_reg renaming in 3.0. Renamed copy_reg to copyreg in the standard library, to avoid spurious warnings and ease later merging to py3k branch. Public documentation remains intact. ........
1 parent 7760008 commit f7fa63d

20 files changed

Lines changed: 309 additions & 307 deletions

Doc/library/copy.rst

Lines changed: 1 addition & 1 deletion
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
:mod:`copy_reg` --- Register :mod:`pickle` support functions
2+
:mod:`copyreg` --- Register :mod:`pickle` support functions
33
============================================================
44

5-
.. module:: copy_reg
5+
.. module:: copyreg
66
:synopsis: Register pickle support functions.
77

88

@@ -11,7 +11,7 @@
1111
module: cPickle
1212
module: copy
1313

14-
The :mod:`copy_reg` module provides support for the :mod:`pickle` and
14+
The :mod:`copyreg` module provides support for the :mod:`pickle` and
1515
:mod:`cPickle` modules. The :mod:`copy` module is likely to use this in the
1616
future as well. It provides configuration information about object constructors
1717
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
@@ -95,7 +95,7 @@ Sample output (may vary depending on the architecture)::
9595

9696
Loaded modules:
9797
_types:
98-
copy_reg: _inverted_registry,_slotnames,__all__
98+
copyreg: _inverted_registry,_slotnames,__all__
9999
sre_compile: isstring,_sre,_optimize_unicode
100100
_sre:
101101
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-
copy_reg.rst
22+
copyreg.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
@@ -524,7 +524,7 @@ not :meth:`__reduce_ex__`, the :meth:`__reduce_ex__` implementation detects this
524524
and calls :meth:`__reduce__`.
525525

526526
An alternative to implementing a :meth:`__reduce__` method on the object to be
527-
pickled, is to register the callable with the :mod:`copy_reg` module. This
527+
pickled, is to register the callable with the :mod:`copyreg` module. This
528528
module provides a way for programs to register "reduction functions" and
529529
constructors for user-defined types. Reduction functions have the same
530530
semantics and interface as the :meth:`__reduce__` method described above, except
@@ -775,7 +775,7 @@ the same process or a new process. ::
775775

776776
.. seealso::
777777

778-
Module :mod:`copy_reg`
778+
Module :mod:`copyreg`
779779
Pickle interface constructor registration for extension types.
780780

781781
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 copy_reg import dispatch_table
52+
from copyreg import dispatch_table
5353

5454
class Error(Exception):
5555
pass
File renamed without changes.

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 copy_reg
40+
import copyreg
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-
copy_reg.pickle(types.CodeType, pickle_code, unpickle_code)
64-
# copy_reg.pickle(types.FunctionType, pickle_function, unpickle_function)
63+
copyreg.pickle(types.CodeType, pickle_code, unpickle_code)
64+
# copyreg.pickle(types.FunctionType, pickle_function, unpickle_function)
6565

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

Lib/os.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def spawnlpe(mode, file, *args):
588588

589589
__all__.extend(["spawnvp", "spawnvpe", "spawnlp", "spawnlpe",])
590590

591-
import copy_reg as _copy_reg
591+
import copyreg as _copyreg
592592

593593
def _make_stat_result(tup, dict):
594594
return stat_result(tup, dict)
@@ -598,7 +598,7 @@ def _pickle_stat_result(sr):
598598
return (_make_stat_result, args)
599599

600600
try:
601-
_copy_reg.pickle(stat_result, _pickle_stat_result, _make_stat_result)
601+
_copyreg.pickle(stat_result, _pickle_stat_result, _make_stat_result)
602602
except NameError: # stat_result may not exist
603603
pass
604604

@@ -610,7 +610,7 @@ def _pickle_statvfs_result(sr):
610610
return (_make_statvfs_result, args)
611611

612612
try:
613-
_copy_reg.pickle(statvfs_result, _pickle_statvfs_result,
613+
_copyreg.pickle(statvfs_result, _pickle_statvfs_result,
614614
_make_statvfs_result)
615615
except NameError: # statvfs_result may not exist
616616
pass

Lib/pickle.py

Lines changed: 4 additions & 4 deletions

0 commit comments

Comments
 (0)