opbeat_python
opbeat_python copied to clipboard
async_mode strange code
I've been browsing the Client code and I came across a line in base.py that stands out.
self.async_mode = (async_mode is True
or (defaults.ASYNC_MODE and async_mode is not False))
I'm guessing this is the intended effect?
self.async_mode = defaults.ASYNC_MODE if async_mode is None else async_mode
@willmcgugan thanks for the headsup, this does indeed look a bit strange. We tried to remember why we wrote it this way, and came to the conclusion that it has to do with the deprecation logic of the async argument. async will become a keyword in Python 3.6, so we introduced a deprecation path a while ago (using async_mode instead of async). We will remove async completely in the next major release, and simplify that line of code as you suggested.