Closed frmdstryr closed 3 years ago
I guess this is because a dfunc isn't a method or function, so it's not worth messing with this.
I will try to have a look nonetheless, it should work.
Indeed declarative functions and methods do not inherit from FunctionType and MethodType meaning that the inspect functions do not know how to handle them. Running them on the __func__
attribute should give meaningful results. We could try to clean up the inheritance but we would have to mirror all the actual function attribute on the dfunc. I am not sure it is worth it. Let me know what you think
Running them on the
__func__
attribute should give meaningful results.
That's good to know if it's ever needed in the future.
I ended up re-writing the part of code using this so it didn't need to check async'ness anymore so i'd say just leave it as is.
Minor issue... but 'async func' methods on enamldefs currently don't seem to properly have "async-ness".
Eg:
inspect.iscorourtinefunction
checks for the CO_COROUTINE flag.I don't remember if this worked before or not but it doesn't on
0.12.0
.