Skip to content

Commit 981e200

Browse files
committed
Replace getattr with an explicit attribute reference
Kept the default behavior. If name is None, then it will convert `var` itself to str.
1 parent 86977db commit 981e200

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymc/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def get_default_varnames(var_iterator, include_transformed):
215215

216216
def get_var_name(var) -> str:
217217
"""Get an appropriate, plain variable name for a variable."""
218-
return str(getattr(var, "name", var))
218+
return str(var.name if var.name is not None else var)
219219

220220

221221
def get_transformed(z):

0 commit comments

Comments
 (0)