1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-15 04:35:19 +00:00

[devalue] better error message for self-referencing custom types

Authored by: bashonly
This commit is contained in:
bashonly
2025-06-11 12:49:08 -05:00
parent 8578e78719
commit 39cb150d76

View File

@@ -79,7 +79,7 @@ def parse_iter(parsed: typing.Any, /, *, revivers: dict[str, collections.abc.Cal
# TODO: implement zips `strict=True`
if reviver := revivers.get(value[0]):
if value[1] == source:
yield IndexError('custom types cannot point to themselves')
yield IndexError(f'{value[0]!r} cannot point to itself (index: {source})')
continue
# inverse order: resolve index, revive value
stack.append((target, index, (value[0], value[1], reviver)))