Move __builtins__.trunc() to math.trunc() per

http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue
1965.
This commit is contained in:
Jeffrey Yasskin 2008-02-01 06:22:46 +00:00
parent 951cc0f474
commit ca2b69f765
9 changed files with 72 additions and 70 deletions

View file

@ -1,11 +1,12 @@
"""Unit tests for numbers.py."""
import unittest
from test import test_support
from numbers import Number
from numbers import Exact, Inexact
from numbers import Complex, Real, Rational, Integral
import math
import operator
import unittest
from numbers import Complex, Real, Rational, Integral
from numbers import Exact, Inexact
from numbers import Number
from test import test_support
class TestNumbers(unittest.TestCase):
def test_int(self):
@ -49,8 +50,8 @@ class TestNumbers(unittest.TestCase):
self.failUnless(issubclass(complex, Inexact))
c1, c2 = complex(3, 2), complex(4,1)
# XXX: This is not ideal, but see the comment in builtin_trunc().
self.assertRaises(AttributeError, trunc, c1)
# XXX: This is not ideal, but see the comment in math_trunc().
self.assertRaises(AttributeError, math.trunc, c1)
self.assertRaises(TypeError, float, c1)
self.assertRaises(TypeError, int, c1)