Skip to content

Commit 03a70fd

Browse files
committed
Use f-string instead of string concatenation
1 parent 395189c commit 03a70fd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pytensor/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,8 @@ def hash_from_code(msg: str | bytes) -> str:
201201
# but Python 3 (unicode) strings don't.
202202
if isinstance(msg, str):
203203
msg = msg.encode()
204-
# Python 3 does not like module names that start with
205-
# a digit.
206-
return "m" + hashlib.sha256(msg).hexdigest()
204+
# Python 3 does not like module names that start with a digit.
205+
return f"m{hashlib.sha256(msg).hexdigest()}"
207206

208207

209208
def uniq(seq: Sequence) -> list:

0 commit comments

Comments
 (0)