Skip to content

Commit db9d077

Browse files
committed
Remove precisely the prefix instead of strip
1 parent 931cc5e commit db9d077

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/sage/interfaces/singular.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ def sage_global_ring(self):
16541654
is_extension = False
16551655
else:
16561656
# it ought to be a finite field
1657-
q = ZZ(charstr[0].lstrip('ZZ/'))
1657+
q = ZZ(charstr[0].removeprefix('ZZ/'))
16581658
from sage.rings.finite_rings.finite_field_constructor import GF
16591659
if q.is_prime():
16601660
br = GF(q)

src/sage/plot/misc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,20 +420,20 @@ def get_matplotlib_linestyle(linestyle, return_type):
420420
return None
421421

422422
if linestyle.startswith("default"):
423-
return get_matplotlib_linestyle(linestyle.strip("default"), "short")
423+
return get_matplotlib_linestyle(linestyle.removeprefix("default"), "short")
424424
elif linestyle.startswith("steps"):
425425
if linestyle.startswith("steps-mid"):
426426
return "steps-mid" + get_matplotlib_linestyle(
427-
linestyle.strip("steps-mid"), "short")
427+
linestyle.removeprefix("steps-mid"), "short")
428428
elif linestyle.startswith("steps-post"):
429429
return "steps-post" + get_matplotlib_linestyle(
430-
linestyle.strip("steps-post"), "short")
430+
linestyle.removeprefix("steps-post"), "short")
431431
elif linestyle.startswith("steps-pre"):
432432
return "steps-pre" + get_matplotlib_linestyle(
433-
linestyle.strip("steps-pre"), "short")
433+
linestyle.removeprefix("steps-pre"), "short")
434434
else:
435435
return "steps" + get_matplotlib_linestyle(
436-
linestyle.strip("steps"), "short")
436+
linestyle.removeprefix("steps"), "short")
437437

438438
if return_type == 'short':
439439
if linestyle in short_to_long_dict.keys():

0 commit comments

Comments
 (0)