jsonargparse
jsonargparse copied to clipboard
lazy_instance and dataclasses ?
🚀 Feature request
Thanks for this awesome library! I would like the following simple example to work:
import jsonargparse
from dataclasses import dataclass
@dataclass
class Bar:
x: int
bar=jsonargparse.lazy_instance(Bar, x=3)
bar.x
Motivation
I really like lazy_instance: Its much nicer than writing long, nested YAML files, but still translates into a nice config Namespace which can be easily reused. However, currently, dataclasses don't seem to be really supported