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

PEP 0316: Modernize code: == None -> is None #2081

Merged
merged 1 commit into from
Sep 21, 2021
Merged

PEP 0316: Modernize code: == None -> is None #2081

merged 1 commit into from
Sep 21, 2021

Conversation

DimitriPapadopoulos
Copy link
Contributor

Change inspired by PEP 0290 (Code Migration and Modernization):

Since there is only one None object, equality can be tested with identity. Identity tests are slightly faster than equality tests. Also, some object types may overload comparison, so equality testing may be much slower.

Pattern::

if v == None  -->  if v is None:
if v != None  -->  if v is not None:

The existing code runs without errors, there is no need to fix this other than "modernization" of the code.

@kasir-barati
Copy link

@brettcannon How can I know when this pep will be released? I am really fascinated in DBC.

I am novice in Python, So please bear with me and gave me as much as possible to read and learn about it

@brettcannon
Copy link
Member

@kasir-barati you will have to either watch the specific PEP, read the release notes of Python, or read the What's New doc when new versions of Python are released.

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

Successfully merging this pull request may close these issues.

4 participants