Hi — question about tvm_ffi.dataclasses.c_class.
Right now @c_class(type_key) fails unless the Python proxy class lists all C++ reflected fields in annotations (otherwise it raises “Missing fields … Defined in C++ but not in Python”). But reflected member functions don’t need any Python-side declaration — they just show up.
This feels inconsistent and makes it hard to generate proxies dynamically (I’d like to create a class directly from reflection metadata without manually duplicating the field list).
Is there a design reason for enforcing the annotation check for fields? If not, would you consider an option like a “non-strict / auto fields” mode where:
if Python has no annotations → auto expose all C++ fields
if Python annotates a subset → expose that subset (no missing-fields error)
still error on extraneous fields (typos)
Thanks!
Hi — question about tvm_ffi.dataclasses.c_class.
Right now @c_class(type_key) fails unless the Python proxy class lists all C++ reflected fields in annotations (otherwise it raises “Missing fields … Defined in C++ but not in Python”). But reflected member functions don’t need any Python-side declaration — they just show up.
This feels inconsistent and makes it hard to generate proxies dynamically (I’d like to create a class directly from reflection metadata without manually duplicating the field list).
Is there a design reason for enforcing the annotation check for fields? If not, would you consider an option like a “non-strict / auto fields” mode where:
if Python has no annotations → auto expose all C++ fields
if Python annotates a subset → expose that subset (no missing-fields error)
still error on extraneous fields (typos)
Thanks!