Simplify comparisons and assignments.
Change comparison with None performed with equality operators to is statement
Remove redundant parentheses.
Change docstring quotes.
Fix typos.