DEV Community

Discussion on: Using Python Functions As Classes

Collapse
 
vberlier profile image
Valentin Berlier

By the way you can do this:

In [1]: return_hello = lambda *args, **kwargs: 'hello'                   

In [2]: class Foo(metaclass=return_hello): ...                           

In [3]: Foo                                                              
Out[3]: 'hello'