Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D DeepPavlov
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 18
    • Issues 18
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DeepPavlov
  • DeepPavlov
  • Merge requests
  • !912

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Andrei Glinskii requested to merge github/fork/cclauss/patch-1 into dev Jul 03, 2019
  • Overview 1
  • Commits 5
  • Pipelines 0
  • Changes 2

Created by: cclauss

Identity is not the same thing as equality in Python.

$ python

>>> mode = "tes"
>>> mode += "t"
>>> mode == "test"
True
>>> mode is "test"
False

flake8 testing of https://github.com/deepmipt/DeepPavlov on Python 3.7.1

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./deeppavlov/dataset_readers/ubuntu_dstc7_mt_reader.py:92:20: F632 use ==/!= to compare str, bytes, and int literals
                if mode is not "test":
                   ^
./deeppavlov/dataset_readers/ubuntu_dstc7_mt_reader.py:97:20: F632 use ==/!= to compare str, bytes, and int literals
                if mode is not "test":
                   ^
2     F632 use ==/!= to compare str, bytes, and int literals
2
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/cclauss/patch-1