Skip to content

Commit 9c4ae03

Browse files
authored
gh-90716: Remove _pylong._DEBUG flag (#99063)
To debug the _pylong module, it's trivial to add this code again locally. There is not need to keep it in Python releases.
1 parent e3b9832 commit 9c4ae03

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Lib/_pylong.py

-9
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import re
1717
import decimal
1818

19-
_DEBUG = False
20-
2119

2220
def int_to_decimal(n):
2321
"""Asymptotically fast conversion of an 'int' to Decimal."""
@@ -32,9 +30,6 @@ def int_to_decimal(n):
3230
# "clever" recursive way. If we want a string representation, we
3331
# apply str to _that_.
3432

35-
if _DEBUG:
36-
print('int_to_decimal', n.bit_length(), file=sys.stderr)
37-
3833
D = decimal.Decimal
3934
D2 = D(2)
4035

@@ -141,8 +136,6 @@ def inner(a, b):
141136
def int_from_string(s):
142137
"""Asymptotically fast version of PyLong_FromString(), conversion
143138
of a string of decimal digits into an 'int'."""
144-
if _DEBUG:
145-
print('int_from_string', len(s), file=sys.stderr)
146139
# PyLong_FromString() has already removed leading +/-, checked for invalid
147140
# use of underscore characters, checked that string consists of only digits
148141
# and underscores, and stripped leading whitespace. The input can still
@@ -281,8 +274,6 @@ def int_divmod(a, b):
281274
"""Asymptotically fast replacement for divmod, for 'int'.
282275
Its time complexity is O(n**1.58), where n = #bits(a) + #bits(b).
283276
"""
284-
if _DEBUG:
285-
print('int_divmod', a.bit_length(), b.bit_length(), file=sys.stderr)
286277
if b == 0:
287278
raise ZeroDivisionError
288279
elif b < 0:

0 commit comments

Comments
 (0)