From 95d97c7390beb72083dac5a801cadfb4c1379fe5 Mon Sep 17 00:00:00 2001 From: Alexandre Vassalotti Date: Fri, 16 May 2008 06:37:57 +0000 Subject: [PATCH] Renamed the repr module to reprlib. Added stub module for repr. --- Lib/lib-old/repr.py | 7 +++++++ Lib/{repr.py => reprlib.py} | 0 Lib/test/test_py3kwarn.py | 4 +++- Misc/NEWS | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Lib/lib-old/repr.py rename Lib/{repr.py => reprlib.py} (100%) diff --git a/Lib/lib-old/repr.py b/Lib/lib-old/repr.py new file mode 100644 index 0000000000..daa21547a8 --- /dev/null +++ b/Lib/lib-old/repr.py @@ -0,0 +1,7 @@ +from warnings import warnpy3k +warnpy3k("The repr module has been renamed to 'reprlib' in Python 3.0", + stacklevel=2) + +from sys import modules +import reprlib +modules[__name__] = repr diff --git a/Lib/repr.py b/Lib/reprlib.py similarity index 100% rename from Lib/repr.py rename to Lib/reprlib.py diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 6864dae74b..857810a45c 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -210,7 +210,9 @@ class TestStdlibRenames(unittest.TestCase): renames = {'copy_reg': 'copyreg', 'Queue': 'queue', 'SocketServer': 'socketserver', - 'ConfigParser': 'configparser'} + 'ConfigParser': 'configparser', + 'repr': 'reprlib', + } def check_rename(self, module_name, new_module_name): """Make sure that: diff --git a/Misc/NEWS b/Misc/NEWS index 3287280419..ea4ba1ad6d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -37,6 +37,9 @@ Extension Modules Library ------- +- The repr module has been renamed 'reprlib'. The old name is now + deprecated. + - The statvfs module has been deprecated for removal in Python 3.0. - The sunaudiodev and SUNAUDIODEV modules have been deprecated for removal in -- 2.50.0