From 9dce823cfd0a9991350184f08a1373f3887134f4 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 18 Sep 2017 00:06:43 +0300 Subject: py/modbuiltins: Implement abs() by dispatching to MP_UNARY_OP_ABS. This allows user classes to implement __abs__ special method, and saves code size (104 bytes for x86_64), even though during refactor, an issue was fixed and few optimizations were made: * abs() of minimum (negative) small int value is calculated properly. * objint_longlong and objint_mpz avoid allocating new object is the argument is already non-negative. --- tests/unix/extra_coverage.py.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index ab638a632..4dc421dab 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -38,7 +38,7 @@ ementation 0 0 # runtime utils -TypeError: can't convert str to int +TypeError: unsupported type for : 'str' TypeError: unsupported types for : 'str', 'str' Warning: test # format float -- cgit v1.2.3