🔮 SuperDuperDB: Bring AI to your database! Build, deploy and manage any AI application directly with your existing data infrastructure, without moving your data. Including streaming inference, scalable model training and vector search.
Currently, everytime a user wants to create his/her own Component, he has to additionally
wrap with @dc.dataclass. This is unnecessary overhead and should be removed as a requirement.
Should be possible with something like this:
import dataclasses as dc
class AutoDataclassMeta(type):
def __new__(cls, name, bases, dct):
# Automatically applies the dataclass decorator to the new class
new_cls = super().__new__(cls, name, bases, dct)
new_cls = dc.dataclass(kw_only=True)(new_cls)
return new_cls
class Component(metaclass=AutoDataclassMeta):
# Now every subclass of Component will automatically be a keyword-only dataclass
pass
class MyComponent(Component):
some_field: int
another_field: str = "default"
# When you instantiate MyComponent, it behaves as a dataclass with keyword-only arguments
comp = MyComponent(some_field=10, another_field='example')
Currently, everytime a user wants to create his/her own
Component
, he has to additionally wrap with@dc.dataclass
. This is unnecessary overhead and should be removed as a requirement.Should be possible with something like this: