]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/utils/_utils.py
Update to ytdl-commit-d1c6c5
[yt-dlp.git] / yt_dlp / utils / _utils.py
index afcb2a16423bb3003b604da896324e5c3c15bf9f..238b0fe694dbaaa0218b0cd2a1e9e0ce22c1dec7 100644 (file)
@@ -130,8 +130,13 @@ def random_user_agent():
 }
 
 
-NO_DEFAULT = object()
-IDENTITY = lambda x: x
+class NO_DEFAULT:
+    pass
+
+
+def IDENTITY(x):
+    return x
+
 
 ENGLISH_MONTH_NAMES = [
     'January', 'February', 'March', 'April', 'May', 'June',
@@ -3223,6 +3228,9 @@ def is_iterable_like(x, allowed_types=collections.abc.Iterable, blocked_types=NO
 
 
 def variadic(x, allowed_types=NO_DEFAULT):
+    if not isinstance(allowed_types, (tuple, type)):
+        deprecation_warning('allowed_types should be a tuple or a type')
+        allowed_types = tuple(allowed_types)
     return x if is_iterable_like(x, blocked_types=allowed_types) else (x, )