Fixing an improper method call #5521
Closed
fazledyn-or
started this conversation in
General
Replies: 1 comment 2 replies
-
Hi @fazledyn-or First of all: thanks so much for checking our code base. What a great idea for making the world a better place™ ❤ We discussed as a team this week and we think If you'd like the credit of raising a pull request, please go ahead. If you're busy, we'll get to it in the near future. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In file: coords.py, class: CellMethod, there is a special method add that raises a NotImplementedError. If a special method supporting a binary operation is not implemented it should return NotImplemented. On the other hand, NotImplementedError should be raised from abstract methods inside user defined base classes to indicate that derived classes should override those methods. iCR suggested that the special method add should return NotImplemented instead of raising an exception.
An example of how NotImplemented helps the interpreter support a binary operation is here.
So, the changes to the code would be something like-
I see the comment written above the exception, but still wondering if it was meant for using
NotImplementedError
instead ofNotImplemented
or not. If it's the later, then I suggest that we follow Python's guideline and usereturn NotImplemented
If it's alright, I can create a PR that you can merge.
Looking forward to hearing from you.
Sponsorship and Support:
This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed – to improve global software supply chain security.
The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.
Beta Was this translation helpful? Give feedback.
All reactions