Uh oh!
There was an error while loading. Please reload this page.
gh-98284: better error message for undefined abstractmethod - #97971
Conversation
bedevere-bot
commented
Oct 6, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
726f869 to
34333a3Comparebedevere-bot
commented
Oct 6, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
34333a3 to
17e8982Comparebedevere-bot
commented
Oct 6, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
| def method_two(self): | ||
| pass | ||
| msg = r"class C without an implementation for abstract methods method_one, method_two" | ||
| msg = r"class C without an implementation for abstract methods 'method_one, method_two'" |
There was a problem hiding this comment.
This is incorrect, we should quote each method individually.
17e8982 to
3edd66eComparebedevere-bot
commented
Oct 7, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
3edd66e to
c351ac2Comparebedevere-bot
commented
Oct 9, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
c351ac2 to
f5a9680Comparebedevere-bot
commented
Oct 9, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
f5a9680 to
53e87c5Comparebedevere-bot
commented
Oct 9, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
53e87c5 to
b2b2d95Comparebedevere-bot
commented
Oct 9, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
b2b2d95 to
820cc21Comparebedevere-bot
commented
Oct 9, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
820cc21 to
c268395Comparebedevere-bot
commented
Oct 9, 2022
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
JelleZijlstra
commented
Oct 9, 2022
You do need a NEWS entry as the good knight Bedevere keeps telling you. Also, avoid force-pushing; it makes review harder. We'll squash-merge anywhere when we merge a PR. |
kaushikcfd
commented
Oct 9, 2022
Done!
Noted, thanks! |
| @@ -0,0 +1,3 @@ | |||
| Improved :class:`TypeError` message for undefined abstract methods of a | |||
There was a problem hiding this comment.
The NEWS entry must refer to an issue, not a PR. You'll have to create an issue and rename the file to have your issue number in the file name.
kaushikcfd
commented
Oct 15, 2022
The CI failure is (most likely) unrelated: |
sobolevn
commented
Oct 15, 2022
Retriggering CI, it is indeed unrelated. |
kaushikcfd
commented
Oct 15, 2022
Thanks, yep that was it. |
kaushikcfd
commented
Nov 4, 2022
Soft ping. |
| method_count > 1 ? "s" : "", | ||
| joined); | ||
| Py_DECREF(joined); | ||
| Py_DECREF(comma_w_quotes_sep); |
There was a problem hiding this comment.
You also need to DECREF this in the two return NULL branches above.
Come to think of it, the second of those already leaks joined. It needs a Py_DECREF(joined).
Error message before:
Error message after this patch:
Given that the style-guide requires method names to be in lowercase, the quotation marks help in differentiating the sentence from the method's name.
abstractmethoddoes not highlight the undefined method name #98284