Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python: Modernise raise-not-implemented query#20086

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
joefarebrother wants to merge5 commits intogithub:main
base:main
Choose a base branch
Loading
fromjoefarebrother:python-qual-raise-not-implemented

Conversation

joefarebrother
Copy link
Contributor

Straightforward port away from pointsTo, and documentation updates

@CopilotCopilotAI review requested due to automatic review settingsJuly 17, 2025 20:59
@joefarebrotherjoefarebrother requested a review froma team as acode ownerJuly 17, 2025 20:59
@joefarebrotherjoefarebrother added the no-change-note-requiredThis PR does not need a change note labelJul 17, 2025
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the "raise-not-implemented" query by migrating away from thepointsTo API to use the newerApiGraphs framework, along with updating documentation for clarity.

  • Replaces the deprecatedpointsTo-based implementation withApiGraphs API for detectingNotImplemented usage
  • Updates query name and description to be more descriptive
  • Improves documentation with clearer explanations and additional references

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
NotImplementedIsNotAnException.qlModernizes query implementation using ApiGraphs instead of pointsTo
NotImplementedIsNotAnException.qhelpUpdates documentation with clearer explanations and additional reference links

@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedJul 17, 2025
edited
Loading

QHelp previews:

python/ql/src/Exceptions/NotImplementedIsNotAnException.qhelp

RaisingNotImplemented

The constantNotImplemented is not anException, but is often confused forNotImplementedError. If it is used as an exception, such as inraise NotImplemented orraise NotImplemented("message"), aTypeError will be raised rather than the expectedNotImplemented. This may make debugging more difficult.

NotImplemented should only be used as a special return value for implementing special methods such as__lt__. Code that is not intended to be called should raiseNotImplementedError.

Recommendation

If aNotImplementedError is intended to be raised, replace the use ofNotImplemented with that. IfNotImplemented is intended to be returned rather than raised, replace theraise withreturn NotImplemented

Example

In the following example, the methodwrong will incorrectly raise aTypeError when called. The methodright will raise aNotImplementedError.

classAbstract(object):defwrong(self):# Will raise a TypeErrorraiseNotImplemented()defright(self):raiseNotImplementedError()

References

joefarebrotherand others added3 commitsJuly 17, 2025 22:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
documentationno-change-note-requiredThis PR does not need a change notePython
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@joefarebrother

[8]ページ先頭

©2009-2025 Movatter.jp