[compat] Add compat_numeric_types
authorSergey M․ <dstftw@gmail.com>
Sat, 5 Mar 2016 17:07:25 +0000 (23:07 +0600)
committerSergey M <dstftw@gmail.com>
Thu, 23 Feb 2017 14:57:53 +0000 (22:57 +0800)
youtube_dl/compat.py

index 7189020192601c289f47eafbda40feefd14cde6c..b257e2e8155c72ea6f560c2f7310ed8f5d0bb234 100644 (file)
@@ -2760,6 +2760,10 @@ else:
     compat_kwargs = lambda kwargs: kwargs
 
 
+compat_numeric_types = ((int, float, long, complex) if sys.version_info[0] < 3
+                        else (int, float, complex))
+
+
 if sys.version_info < (2, 7):
     def compat_socket_create_connection(address, timeout, source_address=None):
         host, port = address
@@ -2895,6 +2899,7 @@ __all__ = [
     'compat_input',
     'compat_itertools_count',
     'compat_kwargs',
+    'compat_numeric_types',
     'compat_ord',
     'compat_os_name',
     'compat_parse_qs',