Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 40360f2

Browse files
committed
Remove broken __round__, __ceil__ and __floor__ from Decimal
1 parent 227e7f5 commit 40360f2

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

Lib/decimal.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,9 +1649,6 @@ def _round_down(self, prec):
16491649
else:
16501650
return -1
16511651

1652-
def __round__(self):
1653-
return self._round_down(0)
1654-
16551652
def _round_up(self, prec):
16561653
"""Rounds away from 0."""
16571654
return -self._round_down(prec)
@@ -1687,19 +1684,13 @@ def _round_ceiling(self, prec):
16871684
else:
16881685
return -self._round_down(prec)
16891686

1690-
def __ceil__(self):
1691-
return self._round_ceiling(0)
1692-
16931687
def _round_floor(self, prec):
16941688
"""Rounds down (not towards 0 if negative)"""
16951689
if not self._sign:
16961690
return self._round_down(prec)
16971691
else:
16981692
return -self._round_down(prec)
16991693

1700-
def __floor__(self):
1701-
return self._round_floor(0)
1702-
17031694
def _round_05up(self, prec):
17041695
"""Round down unless digit prec-1 is 0 or 5."""
17051696
if prec and self._int[prec-1] not in '05':

0 commit comments

Comments
 (0)