Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ==/!= to compare str, bytes, and int literals #172

Merged
merged 1 commit into from
Dec 10, 2019

Commits on Dec 10, 2019

  1. Use ==/!= to compare str, bytes, and int literals

    Identity is not the same thing as equality in Python so use ==/!= to compare str, bytes, and int literals. In Python >= 3.8, these instances will raise SyntaxWarnings so it is best to fix them now. https://docs.python.org/3.8/whatsnew/3.8.html#porting-to-python-3-8
    
    $ python
    ```
    >>> pandas = "panda"
    >>> pandas += "s"
    >>> pandas == "pandas"
    True
    >>> pandas is "pandas"
    False
    ```
    cclauss committed Dec 10, 2019
    Configuration menu
    Copy the full SHA
    cee80fc View commit details
    Browse the repository at this point in the history