Closed hvraven closed 5 years ago
One could work around the API change by adding a **kwargs
parameter to addListener
and check whether async
is part of it. This requires only string comparison, thus the keyword introduction is not an issue.
For Python versions >= 3.7 changes to user code would still be required, but code running in older versions would work without change. I could add this if it is desired.
I would suggest changing the parameter to sync
and reversing the sense of the boolean (including the default value). We should also add a **kw
args as you suggest for backwards compatibility.
I like the idea of using sync instead and inverting the logic, gets rid of this ugly underscore. I made the changes and updated the PR. I've also added the **kwargs
wrapper with a comment.
async has become a keyword in python 3.7 (see what's new), making the current version unusable in 3.7. This renames
async
to_async
at the relevant locations, even though I am up for any other name. This creates a breaking change in the API as it used in the parameter list ofLabradProtocol.addListener
.