]> jfr.im git - yt-dlp.git/blob - devscripts/lazy_load_template.py
[lazy_extractors] Fix `suitable` and add flake8 test
[yt-dlp.git] / devscripts / lazy_load_template.py
1 #!/usr/bin/env python3
2 # coding: utf-8
3 from __future__ import unicode_literals
4
5 import re
6
7
8 class LazyLoadExtractor(object):
9 _module = None
10
11 def __new__(cls, *args, **kwargs):
12 mod = __import__(cls._module, fromlist=(cls.__name__,))
13 real_cls = getattr(mod, cls.__name__)
14 instance = real_cls.__new__(real_cls)
15 instance.__init__(*args, **kwargs)
16 return instance