Skip to content

Commit c2fe1bf

Browse files
authored
fix UUID function (#1988)
- fix docstring - clearer exception condition
1 parent 9112532 commit c2fe1bf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arcade/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,12 @@ def wrapper(*args, **kwargs):
136136

137137
def generate_uuid_from_kwargs(**kwargs) -> str:
138138
"""
139-
Given key/pair combos, returns a string in uuid format.
140-
Such as `text='hi', size=32` it will return "text-hi-size-32".
141-
Called with no parameters, id does NOT return a random unique id.
139+
Given key/pair combos, returns a string in "UUID" format.
140+
With inputs such as `text='hi', size=32` it will return `"text=hi|size=32"`.
141+
This function does NOT return a random unique ID.
142+
It must be called with parameters, and will raise an error if passed no keyword arguments.
142143
"""
143-
if len(kwargs) == 0:
144+
if not kwargs:
144145
raise Exception("generate_uuid_from_kwargs has to be used with kwargs, please check the doc.")
145146

146147
return "|".join(f"{key}={str(value)}" for key, value in kwargs.items())

0 commit comments

Comments
 (0)