summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-05-09 05:18:40 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-05-09 05:18:40 (GMT)
commitd7265d64831f870f46b7c61244b2c86dc803f292 (patch)
tree7c16633c07b27002f987e70296ade6c1b26a0601
parentd03238a6473cbf5d81d9d99c71e1bab36c3455d8 (diff)
downloadcpython-d7265d64831f870f46b7c61244b2c86dc803f292.zip
cpython-d7265d64831f870f46b7c61244b2c86dc803f292.tar.gz
cpython-d7265d64831f870f46b7c61244b2c86dc803f292.tar.bz2
Deprecate the new module for removal in 3.0.
-rw-r--r--Doc/library/new.rst4
-rw-r--r--Lib/new.py7
-rw-r--r--Lib/test/test_new.py3
-rw-r--r--Lib/test/test_py3kwarn.py2
-rw-r--r--Misc/NEWS2
5 files changed, 13 insertions, 5 deletions
diff --git a/Doc/library/new.rst b/Doc/library/new.rst
index 1858009..25eb33e 100644
--- a/Doc/library/new.rst
+++ b/Doc/library/new.rst
@@ -4,6 +4,10 @@
.. module:: new
:synopsis: Interface to the creation of runtime implementation objects.
+ :deprecated:
+
+.. deprecated:: The new module has been removed in Python 3.0.
+
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
diff --git a/Lib/new.py b/Lib/new.py
index 1a5c11f..e5f964f 100644
--- a/Lib/new.py
+++ b/Lib/new.py
@@ -3,9 +3,10 @@
This module is no longer required except for backward compatibility.
Objects of most types can now be created by calling the type object.
"""
-from warnings import warnpy3k as _warnpy3k
-_warnpy3k("The 'new' module is not supported in 3.x, use the 'types' module "
- "instead.", stacklevel=2)
+from warnings import warnpy3k
+warnpy3k("The 'new' module has been removed in Python 3.0; use the 'types' "
+ "module instead.", stacklevel=2)
+del warnpy3k
from types import ClassType as classobj
from types import FunctionType as function
diff --git a/Lib/test/test_new.py b/Lib/test/test_new.py
index c243b59..231f4bb 100644
--- a/Lib/test/test_new.py
+++ b/Lib/test/test_new.py
@@ -1,6 +1,7 @@
import unittest
from test import test_support
-import sys, new
+import sys
+new = test_support.import_module('new', deprecated=True)
class NewTest(unittest.TestCase):
def test_spam(self):
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index dd7c765..0933382 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -126,7 +126,7 @@ class TestPy3KWarnings(unittest.TestCase):
class TestStdlibRemovals(unittest.TestCase):
- all_platforms = ('audiodev', 'imputil', 'mutex', 'user')
+ all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new')
def check_removal(self, module_name):
"""Make sure the specified module, when imported, raises a
diff --git a/Misc/NEWS b/Misc/NEWS
index a4f886b..08d36c4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -20,6 +20,8 @@ Extension Modules
Library
-------
+- The new module has been deprecated for removal in Python 3.0.
+
- The user module has been deprecated for removal in Python 3.0.
- The stringold module has been deprecated for removal in Python 3.0.