[Bug]: Defining custom class without docval prevents read #1159
Labels
category: bug
errors in the code or code behavior
priority: low
alternative solution already working and/or relevant to only specific user(s)
Milestone
What happened?
Example here: catalystneuro/ndx-anatomical-localization#1
When the constructor of a registered class uses a list of arguments instead of docval as in:
The construct process relies on
docval
to set thekwargs
that are passed to the class constructor:Here,
kwargs
is empty. This results in aConstructError
on the last line above that says all required arguments are missing.I suggest we change the construct process to use https://docs.python.org/3.12/library/inspect.html#introspecting-callables-with-the-signature-object in addition to docval until docval is removed.
This is not blocking because extension builders can still define their
__init__
withdocval
, but it would be nice to change as we transition away from usingdocval
.Steps to Reproduce
Traceback
No response
Operating System
macOS
Python Executable
Conda
Python Version
3.12
Package Versions
No response
The text was updated successfully, but these errors were encountered: