Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

async_mode strange code #140

Open
willmcgugan opened this issue Oct 20, 2016 · 1 comment
Open

async_mode strange code #140

willmcgugan opened this issue Oct 20, 2016 · 1 comment

Comments

@willmcgugan
Copy link

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
@beniwohli
Copy link
Member

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants