Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-90716: Remove _pylong._DEBUG flag #99063

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions Lib/_pylong.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import re
import decimal

_DEBUG = False


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

if _DEBUG:
print('int_to_decimal', n.bit_length(), file=sys.stderr)

D = decimal.Decimal
D2 = D(2)

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