]> granicus.if.org Git - python/commitdiff
Deprecate the fpformat module for removal in 3.0.
authorBrett Cannon <bcannon@gmail.com>
Sat, 10 May 2008 22:11:45 +0000 (22:11 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 10 May 2008 22:11:45 +0000 (22:11 +0000)
Doc/library/fpformat.rst
Lib/fpformat.py
Lib/test/test_fpformat.py
Lib/test/test_py3kwarn.py
Misc/NEWS

index 6627c8110341e192afac2de2793cc387195fe4c0..e82e16484286132774dd05bae2e8493ff054faf8 100644 (file)
@@ -4,6 +4,11 @@
 
 .. module:: fpformat
    :synopsis: General floating point formatting functions.
+   :deprecated:
+   
+.. deprecated:: 2.6
+    The fpformat module has been removed in Python 3.0.
+   
 .. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
 
 
index 0ae86a913fe636c247f313a0548ca1591f0605d0..71cbb25f3c8b9eb861415eca88358aeb049202ff 100644 (file)
@@ -10,6 +10,9 @@ Parameters:
 x:             number to be formatted; or a string resembling a number
 digits_behind: number of digits behind the decimal point
 """
+from warnings import warnpy3k
+warnpy3k("the fpformat module has been removed in Python 3.0", stacklevel=2)
+del warnpy3k
 
 import re
 
index a1b872262a6609b17be909a822b38e3299459b45..a951cd04583b7c7088fd55df303b146f0ed1a697 100644 (file)
@@ -2,9 +2,10 @@
    Tests for fpformat module
    Nick Mathewson
 '''
-from test.test_support import run_unittest
+from test.test_support import run_unittest, import_module
 import unittest
-from fpformat import fix, sci, NotANumber
+fpformat = import_module('fpformat', deprecated=True)
+fix, sci, NotANumber = fpformat.fix, fpformat.sci, fpformat.NotANumber
 
 StringType = type('')
 
index 30f1668f5faa46bf98b7c3f67bb90ea80a2caaa9..8c3c857fddfee03b59ce3ac36444fa358f315d81 100644 (file)
@@ -129,7 +129,7 @@ class TestStdlibRemovals(unittest.TestCase):
     # test.testall not tested as it executes all unit tests as an
     # import side-effect.
     all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
-                        'Bastion', 'compiler', 'dircache')
+                        'Bastion', 'compiler', 'dircache', 'fpformat')
     inclusive_platforms = {'irix':('pure',)}
     # XXX Don't know if lib-tk is only installed if _tkinter is built.
     optional_modules = ('bsddb185', 'Canvas', 'dl')
index c783d273bab7639ae0971937183e0ad8ef2816f7..c1a30385f960c583a701af1b6d8bb436198d6e59 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -23,6 +23,8 @@ Extension Modules
 Library
 -------
 
+- The fpformat module has been deprecated for removal in Python 3.0.
+
 - The dl module has been deprecated for removal in Python 3.0.
 
 - The Canvas module has been deprecated for removal in Python 3.0.