mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
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:
parent
951cc0f474
commit
ca2b69f765
9 changed files with 72 additions and 70 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue