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 #2242

Merged
merged 1 commit into from Aug 7, 2019

Conversation

@cclauss
Copy link
Contributor

commented Jul 30, 2019

Description

(Description of what the PR does, such as fixes # {issue number})

$ python

>>> 1 == 1.0
True
>>> 1 is 1.0
False

How to test

(Description of how to validate or test this PR)

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

Contributor license agreement signed?

CLA [x] (Whether you have signed a CLA - Contributor Licensing Agreement

Identity is not the same thing as equality in Python

$ python
```
>>> 1 == 1.0
True
>>> 1 is 1.0
False
```
@devs-mycroft

This comment has been minimized.

Copy link
Collaborator

commented Jul 30, 2019

Hello, @cclauss, thank you for helping with the Mycroft project! We welcome everyone
into the community and greatly appreciate your help as we work to build an AI
for Everyone.

To protect yourself, the project, and users of Mycroft technologies we require
a Contributor Licensing Agreement (CLA) before accepting any code
contribution. This agreement makes it crystal clear that along with your
code you are offering a license to use it within the confines of this project.
You retain ownership of the code, this is just a license.

Please visit https://mycroft.ai/cla to initiate this one-time signing. Thank
you!

@krisgesling

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

Thanks Christian,

Based off your commit messages I'm guessing you have already completed the CLA form. This is a slightly manual process on our end to avoid abuse, but let me know if an email doesn't arrive and I'll give them a nudge.

Once we have confirmation that it's signed we can merge this in, and the best part is you only have to deal with the CLA once :)

@krisgesling

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

This was actually one of my commits and good to have it flagged. I'm relatively new to Python and was thinking of is and == as synonymous, I even tried to use is more to force myself to be more 'Pythonic'. However I can see now that is compares identities not values which makes a whole lot of sense.

@krisgesling krisgesling added CLA: Yes and removed CLA: Needed labels Aug 7, 2019
@krisgesling krisgesling merged commit 754da78 into MycroftAI:dev Aug 7, 2019
3 checks passed
3 checks passed
:-) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 51.25%
Details
@cclauss cclauss deleted the cclauss:patch-2 branch Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.