Skip to content

bpo-34331: Fix incorrectly pluralized abstract class error message.#8670

Merged
matrixise merged 12 commits into
python:masterfrom
dangro:issue-34331
Sep 11, 2019
Merged

bpo-34331: Fix incorrectly pluralized abstract class error message.#8670
matrixise merged 12 commits into
python:masterfrom
dangro:issue-34331

Conversation

@dangro

@dangro dangro commented Aug 4, 2018

Copy link
Copy Markdown
Contributor

Comment thread Objects/typeobject.c Outdated
Comment thread Misc/NEWS.d/next/C API/2018-08-04-00-59-44.bpo-34331.iaUkmU.rst Outdated
@csabella

Copy link
Copy Markdown
Contributor

@merwok @ericvsmith This looks ready to merge to me. Was this on hold for any reason or can it be merged? Thanks!

Comment thread Lib/test/test_abc.py Outdated
@csabella

Copy link
Copy Markdown
Contributor

@dangro Please resolve the merge conflict and address the last reviews by @merwok. Thanks!

Comment thread Objects/typeobject.c Outdated
@csabella
csabella requested review from ericvsmith and merwok May 13, 2019 13:01
@ericvsmith

Copy link
Copy Markdown
Member

While the change looks fine to me, I personally think it's not worth the additional code in order to get the minor improvement. Was anyone actually confused by the message?

@dangro

dangro commented May 16, 2019

Copy link
Copy Markdown
Contributor Author

It is just a polishing change. It is my understanding that this has been done for other error messages.

@ericvsmith

Copy link
Copy Markdown
Member

I understand the nature of the change. I just think it's not worth doing. I'm not going to stop anyone from committing this, though.

Comment thread Objects/typeobject.c Outdated
Py_DECREF(sorted_methods);
if (joined == NULL)
return NULL;
method_count = PyObject_Length(abstract_methods);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest you base method_count on sorted_methods, not abstract_methods, since it's sorted_methods that's used to produce joined. I realize it doesn't make much difference, but I think it's easier to reason about. You'd need to move this line to before where you Py_DECREF(sorted_methods).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@CuriousLearner CuriousLearner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🌮

@matrixise

Copy link
Copy Markdown
Member

Thank you for your contribution

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants