Closed ramikg closed 2 weeks ago
Thank you for this PR @ramikg. Great that you're pointing this out!
Though, do you need this functionality? I'd much rather remove the possibility to a string instead of the action, thus removing the lines https://github.com/StevenLooman/async_upnp_client/pull/246/files#diff-c110a3c46f87b9f3bcf2ffe5e7f7df92e8b598a5bfb74caae942bb11e32285b9R519-R520 This prevents a change in the API (albeit is it just a widening of the API). I do think this is just some very old code.
I personally don't need this functionality, but this might break some existing code which ignores this type error. (E.g. I found upnp-av-control, which passes strings to this function. This specific usage probably won't break as the version is locked and they're using Renovate.)
In any case, the fix should be easy, so whatever you choose is okay.
Thank you for pointing this out. Lets not break any existing code.
To fix the build rename the file changes/246.bugfix.rst
to changes/246.bugfix
. Then I'll merge this PR.
Thank you, done.
Thanks!
The first line of
async_call_action
checks whether theaction
argument is a string, so it makes sense for the function signature to accept anaction
of typestr
.I've used
Union
instead of|
in order to support Python versions < 3.10, which this library currently stops.