Skip to content

Commit 2925f66

Browse files
committed
Added placeholders to lambda functions to make sure sorting criteria tuples are of same length
1 parent 975f04a commit 2925f66

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/murfey/cli/generate_config.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,13 @@ def construct_list(
225225
sorted(
226226
lst,
227227
key=lambda v: (
228-
(0, float(v))
228+
(0, float(v), 0)
229229
if isinstance(v, (int, float))
230-
else (1, abs(v), v.real) if isinstance(v, complex) else (2, str(v))
230+
else (
231+
(1, abs(v), v.real)
232+
if isinstance(v, complex)
233+
else (2, str(v), "")
234+
)
231235
),
232236
)
233237
if sort_values
@@ -329,12 +333,12 @@ def is_type(value: str, instance: Type[Any] | tuple[Type[Any], ...]) -> bool:
329333
for key in sorted(
330334
dct.keys(),
331335
key=lambda k: (
332-
(0, float(k))
336+
(0, float(k), 0)
333337
if is_type(k, (int, float))
334338
else (
335339
(1, abs(complex(k)), complex(k).real)
336340
if is_type(k, complex)
337-
else (2, str(k))
341+
else (2, str(k), "")
338342
)
339343
),
340344
)

0 commit comments

Comments
 (0)