Steps to reproduce
-
Set up a bot with a MessageQueue as described in the wiki
-
pass a Defaults object to the bot
Expected behaviour
Defaults should be used
Actual behaviour
They're not. Instead ValueError("Function has keyword-only parameters or annotations" is raised
Why this happens & how to overcome
getargspec is deprecated in favor of getfullargspec. This can easily be resolved
- This doesn't suffice yet, as the methods of
MQBot override the bots methods and are decorated. getfullargspec can't see through the decorator. using inspect.getfullargspec(inspect.unwrap(method)) can resolve that
- This still only works, if we explicitly list the methods args & kwargs while overriden in
MQBot
After #2012 this is one more reason to tackle MQ in v13.X/v14. Just adding inspect.getfullargspec(inspect.unwrap(method)) as a more or less quick fix doesn't really seem right to me …
Steps to reproduce
Set up a bot with a MessageQueue as described in the wiki
pass a
Defaultsobject to the botExpected behaviour
Defaults should be used
Actual behaviour
They're not. Instead
ValueError("Function has keyword-only parameters or annotations"is raisedWhy this happens & how to overcome
getargspecis deprecated in favor ofgetfullargspec. This can easily be resolvedMQBotoverride the bots methods and are decorated.getfullargspeccan't see through the decorator. usinginspect.getfullargspec(inspect.unwrap(method))can resolve thatMQBotAfter #2012 this is one more reason to tackle MQ in v13.X/v14. Just adding
inspect.getfullargspec(inspect.unwrap(method))as a more or less quick fix doesn't really seem right to me …