GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-115808: Add ``is_none`` and ``is_not_none`` operators by ThexXTURBOXx · Pull Request #115814 · python/cpython

Conversation

@ThexXTURBOXx

@ThexXTURBOXx ThexXTURBOXx commented Feb 22, 2024 •
edited by AlexWaygood
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR adds an is_none operator and an appropriate test.
I hope I did not forget to update/reference it anywhere else.

Fixes #115808

  • Issue: Add operator.is_none() #115808

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ghost

ghost commented Feb 22, 2024 •
edited by ghost
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.
CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label Feb 22, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Feb 22, 2024
Add operator.is_none() #115808
Closed
@bedevere-app

bedevere-app Bot commented Feb 22, 2024

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4
Eclips4 requested a review from rhettinger February 22, 2024 10:17
Eclips4
Eclips4 reviewed Feb 22, 2024
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2024-02-22-10-12-59.gh-issue-115808.F2g2Ku.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4

Eclips4 commented Feb 22, 2024

Copy link
Copy Markdown
Member

Please, update the documentation for this module (Doc/library/operator.rst)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx

ThexXTURBOXx commented Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

@Eclips4 Thank you for the suggestion, updated it accordingly.

Eclips4 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood previously requested changes Feb 22, 2024
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! In order for this to be merged, it would also need:

  • Documentation to be added in Doc/library/operator.rst
  • An entry in Doc/whatsnew/3.13.rst
  • An additional implementation written in C in https://github.com/python/cpython/blob/main/Modules/_operator.c

Here's the most recent PR that added a new function to the operator module, which you could use as a reference:

  • #27888

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Eclips4 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting review labels Feb 22, 2024
@bedevere-app

bedevere-app Bot commented Feb 22, 2024

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx

ThexXTURBOXx commented Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood reviewed Feb 22, 2024
View reviewed changes
Comment thread Doc/library/operator.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

AlexWaygood
AlexWaygood reviewed Feb 22, 2024
View reviewed changes
Comment thread Doc/library/operator.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_operator.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx

ThexXTURBOXx commented Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood
AlexWaygood dismissed their stale review February 22, 2024 14:49

Requested changes were made

@bedevere-app bedevere-app Bot added awaiting review and removed awaiting changes labels Feb 22, 2024
@AlexWaygood
AlexWaygood requested a review from Eclips4 February 22, 2024 15:09
AlexWaygood
AlexWaygood reviewed Feb 22, 2024
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks pretty good to me now. We'll need to wait a while to see if anybody voices any objections on the issue before we can consider merging this, though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ThexXTURBOXx

ThexXTURBOXx commented Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

No problem, take your time! And thank you very much for your valuable comments. They helped me shape my first PR here such that it fits your needs!

AlexWaygood reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sobolevn
sobolevn reviewed Feb 22, 2024
View reviewed changes

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I have several nitpicks :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/_operator.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Modules/_operator.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_operator.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/operator.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx ThexXTURBOXx mentioned this pull request Feb 22, 2024
Refactor operators #115830
Closed
Eclips4
Eclips4 approved these changes Feb 22, 2024
View reviewed changes

@Eclips4 Eclips4 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good for me. Good job @ThexXTURBOXx 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ThexXTURBOXx reacted with laugh emoji AlexWaygood and bateller reacted with hooray emoji
All reactions
  • 😄 1 reaction
  • 🎉 2 reactions
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Feb 22, 2024
bateller
bateller approved these changes Feb 22, 2024
View reviewed changes

@bateller bateller left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Fidget-Spinner
Fidget-Spinner reviewed Feb 22, 2024
View reviewed changes
Comment thread Modules/_operator.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx
pythongh-115808: Add is_none operator
72ccb45
ThexXTURBOXx added 4 commits March 4, 2024 15:07
@ThexXTURBOXx
Fix method declaration
dcfb77a
@ThexXTURBOXx
Cleanup test for is_none
8661aec
@ThexXTURBOXx
Add another test
90d6867
@ThexXTURBOXx
Rearrange everything to be in the same order
354acfb
@ThexXTURBOXx
ThexXTURBOXx force-pushed the issue-115808 branch from 434bc8b to 354acfb Compare March 4, 2024 14:07
@ThexXTURBOXx

ThexXTURBOXx commented Mar 4, 2024 •
edited by Eclips4
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Rebased on main

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx
Merge branch 'main' into issue-115808
5a4382f
@ThexXTURBOXx

ThexXTURBOXx commented May 17, 2024

Copy link
Copy Markdown
Contributor Author

Rebased on main

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx
Merge branch 'main' into issue-115808
cc9660a
@ThexXTURBOXx

ThexXTURBOXx commented Aug 6, 2024

Copy link
Copy Markdown
Contributor Author

Rebased on main

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Eclips4
Eclips4 reviewed Aug 6, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.13.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/operator.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx
Apply suggestions
576a085
@ThexXTURBOXx

ThexXTURBOXx commented Aug 6, 2024

Copy link
Copy Markdown
Contributor Author

Thanks for the comments - fixed!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4

Eclips4 commented Aug 6, 2024

Copy link
Copy Markdown
Member

Thanks for the comments - fixed!

Looks good, thanks.

However, what is about is_not_none #115808 (comment)?

I think it should be implemented, and I think that it is okay to do so in this PR, since these things are related.

cc @AlexWaygood @rhettinger

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx
Add is_not_none operator
bdf17ff
@ThexXTURBOXx

ThexXTURBOXx commented Aug 6, 2024

Copy link
Copy Markdown
Contributor Author

However, what is about is_not_none #115808 (comment)?
I think it should be implemented, and I think that it is okay to do so in this PR, since these things are related.

You are right. I haven't seen this comment yet. I have also added an appropriate is_not_none function.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ThexXTURBOXx
Fix is_not_none operator
d8fed16
Eclips4
Eclips4 reviewed Aug 6, 2024
View reviewed changes
Comment thread Modules/_operator.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Eclips4 Eclips4 changed the title gh-115808: Add is_none operator gh-115808: Add is_none and is_not_none operators Aug 6, 2024
AA-Turner
AA-Turner approved these changes Aug 7, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Aug 7, 2024
@AA-Turner

AA-Turner commented Aug 7, 2024

Copy link
Copy Markdown
Member

If there are no outstanding concerns I'll look to merge this in the next few days (cc @Eclips4 if you have any final comments)

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Eclips4
Eclips4 approved these changes Aug 7, 2024
View reviewed changes

@Eclips4 Eclips4 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @ThexXTURBOXx for your efforts!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ThexXTURBOXx

ThexXTURBOXx commented Aug 7, 2024

Copy link
Copy Markdown
Contributor Author

You're more than welcome, thanks for the reviews! :)

Eclips4 reacted with heart emoji Eclips4 reacted with rocket emoji
All reactions
  • ❤️ 1 reaction
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner
AA-Turner merged commit 5580f31 into python:main Aug 10, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 10, 2024
@AA-Turner

AA-Turner commented Aug 10, 2024

Copy link
Copy Markdown
Member

Thanks all!

A

Eclips4, ThexXTURBOXx, and bateller reacted with heart emoji Eclips4, ThexXTURBOXx, and bateller reacted with rocket emoji
All reactions
  • ❤️ 3 reactions
  • 🚀 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ZeroIntensity ZeroIntensity mentioned this pull request Aug 17, 2024
Add stubs for operator.is_none and operator.is_not_none python/typeshed#12535
Merged
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
@ThexXTURBOXx @Eclips4 @blhsing
pythongh-115808: Add is_none and is_not_none to operator (p…
34f25eb
…ython#115814)

Co-authored-by: Kirill Podoprigora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sobolevn sobolevn sobolevn left review comments
@Fidget-Spinner Fidget-Spinner Fidget-Spinner left review comments
@AlexWaygood AlexWaygood AlexWaygood left review comments
@AA-Turner AA-Turner AA-Turner approved these changes
@Eclips4 Eclips4 Eclips4 approved these changes
@rhettinger rhettinger Awaiting requested review from rhettinger
+1 more reviewer
@bateller bateller bateller approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add operator.is_none()

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@ThexXTURBOXx @Eclips4 @AA-Turner @sobolevn @bateller @Fidget-Spinner @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.