ezmsg-org/ezmsg

gen_to_unit: settings should use `signature` instead of `getfullargspec`

Closed this issue · 2 comments

I think it's the same issue as here: joblib/joblib#1164

I'm guessing that the settings-reading code in gen_to_unit was written before the @consumer wrapper was written.

If you dive into getfullargspec, the first thing it does is call _signature_from_callable(func, follow_wrapper_chains=False, ...).
If we could set that to follow_wrapper_chains=True then it would properly inspect the wrapped-function's arguments. But that is hard-coded.

In our case, this hasn't been too detrimental so far because we are still able to get the settings annotations using get_type_hints(func) but this doesn't know anything about default values.

Hmm. gen_to_unit is a bit of a beast -- @pperanich when you find time could you weigh in?

I've already made some good progress and added some unit tests. I'll make a PR soon.