Skip to content

Commit 239c6f9

Browse files
author
Release Manager
committed
gh-40419: Remove unnecessary empty string in print function <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> Autofix a few [`FURB105`](https://docs.astral.sh/ruff/rules/print-empty- string/) errors with `ruff check src/sage --select FURB105 --fix` in the first commit and enforce the rule in the second commit to avoid regression. Let me know if updating `pyproject.toml` with enforceable rules are ok or not. I can revert the second commit if needed. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40419 Reported by: Trinh Quoc Anh Reviewer(s): Frédéric Chapoton
2 parents 51b3b30 + 671c729 commit 239c6f9

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

build/sage_bootstrap/download/cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def run():
9898
app = Application(timeout=args.timeout, quiet=args.quiet)
9999
if (not args.print_fastest_mirror) and (args.url_or_tarball is None):
100100
parser.print_help()
101-
print('')
101+
print()
102102
print('error: either --print-fastest-mirror or url_or_tarball is required')
103103
sys.exit(2)
104104
if args.print_fastest_mirror:

src/sage/combinat/cluster_algebra_quiver/cluster_seed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4464,7 +4464,7 @@ def find_upper_bound(self, verbose=False):
44644464
new_gen_found = True
44654465
if verbose:
44664466
print('Found a new element in', spend, 'seconds!')
4467-
print('')
4467+
print()
44684468
i += 1
44694469

44704470
def get_upper_cluster_algebra_element(self, a):

src/sage/logic/logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def print_table(self, table):
276276
line += s
277277
i += 1
278278
print(line)
279-
print("")
279+
print()
280280

281281
def combine(self, statement1, statement2):
282282
r"""

src/sage/rings/number_field/totallyreal_rel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def incr(self, f_out, verbose=False, haltk=0):
430430
print(k, ":", end="")
431431
for i in range(self.m + 1):
432432
print(self.a[i], end="")
433-
print("")
433+
print()
434434

435435
if k == m - 2:
436436
# We only know the value of a[n-1], the trace.

src/sage/rings/polynomial/multi_polynomial_ideal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def _groebner_basis_magma(self, deg_bound=None, prot=False, magma=magma_default)
436436
mgb = mself.GroebnerBasis()
437437

438438
if prot == "sage":
439-
print("")
439+
print()
440440
print("Highest degree reached during computation: %2d." % log_parser.max_deg)
441441

442442
# TODO: rewrite this to be much more sophisticated in multi-level nested cases.
@@ -1560,7 +1560,7 @@ def _groebner_basis_singular_raw(self, algorithm='groebner', singular=None, *arg
15601560
raise TypeError("algorithm '%s' unknown" % algorithm)
15611561
self.__gb_singular = S
15621562
if prot == "sage":
1563-
print("")
1563+
print()
15641564
print("Highest degree reached during computation: %2d." % log_parser.max_deg)
15651565
return S
15661566

src/sage/sandpiles/sandpile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5917,11 +5917,11 @@ def sandlib(selector=None):
59175917
3: [1, 2]}},
59185918
}
59195919
if selector is None:
5920-
print('')
5920+
print()
59215921
print(' Sandpiles in the sandlib:')
59225922
for i in sorted(sandpiles):
59235923
print(' ', i, ':', sandpiles[i]['description'])
5924-
print("")
5924+
print()
59255925
elif selector not in sandpiles:
59265926
print(selector, 'is not in the sandlib.')
59275927
else:

src/sage_setup/autogen/flint/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def write_flint_cython_headers(output_dir, documentation=False):
9494
print(' ## {}'.format(section), file=output)
9595
for func_signatures, doc in content[section]:
9696
if documentation:
97-
print('', file=output)
97+
print(file=output)
9898
for line in doc:
9999
print(' # {}'.format(line), file=output)
100100
for line in func_signatures:

0 commit comments

Comments
 (0)