Skip to content

Commit 474ef9e

Browse files
committed
Use f-string instead of string concatenation
1 parent 2677a6e commit 474ef9e

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
@@ -202,9 +202,8 @@ def hash_from_code(msg: str | bytes) -> str:
202202
# but Python 3 (unicode) strings don't.
203203
if isinstance(msg, str):
204204
msg = msg.encode()
205-
# Python 3 does not like module names that start with
206-
# a digit.
207-
return "m" + hashlib.sha256(msg).hexdigest()
205+
# Python 3 does not like module names that start with a digit.
206+
return f"m{hashlib.sha256(msg).hexdigest()}"
208207

209208

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

0 commit comments

Comments
 (0)