unbound method type.mro() needs an argument
grauvictor opened this issue · comments
grauvictor commented
I get the following error:
File "/home/victor/venv-python3.9-llm-explo/lib/python3.9/site-packages/tyro/_docstrings.py", line 121, in get_class_tokenization_with_field
classes_to_search = cls.mro()
TypeError: unbound method type.mro() needs an argument
Du to the following line:
Line 120 in 152b889
Called on the following type:
<class 'pydantic.v1.main.ModelMetaclass'>
Suggestion:
Replace
Line 120 in 152b889
by:
classes_to_search = cls.__mro__
Brent Yi commented
Hi, thanks for filing this issue and the fix suggestion!
Are you able to share a runnable example for reproducing the error? The fix seems reasonable, but I'm not fully following the root cause of the problem (particularly in what situation the cls
value gets set to a metaclass) and it'd be nice to include this case in the unit tests.