mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-03 08:35:32 +00:00
[utils] Allow partial application for even more functions (#11437)
Fixes b6dc2c49e8
Authored by: Grub4K
This commit is contained in:
@ -449,6 +449,14 @@ def trim_str(*, start=None, end=None):
|
||||
return trim
|
||||
|
||||
|
||||
def unpack(func):
|
||||
@functools.wraps(func)
|
||||
def inner(items, **kwargs):
|
||||
return func(*items, **kwargs)
|
||||
|
||||
return inner
|
||||
|
||||
|
||||
def get_first(obj, *paths, **kwargs):
|
||||
return traverse_obj(obj, *((..., *variadic(keys)) for keys in paths), **kwargs, get_all=False)
|
||||
|
||||
|
Reference in New Issue
Block a user