mirror of
https://github.com/quantum5/optimize-later.git
synced 2025-04-24 12:32:04 -04:00
8 lines
275 B
Python
8 lines
275 B
Python
|
from types import FunctionType
|
||
|
|
||
|
|
||
|
class NoArgDecoratorMeta(type):
|
||
|
def __call__(cls, *args, **kwargs):
|
||
|
if len(args) == 1 and isinstance(args[0], FunctionType):
|
||
|
return cls()(args[0])
|
||
|
return super(NoArgDecoratorMeta, cls).__call__(*args, **kwargs)
|