Skip to content

bpo-32494: Add gdbm.count()#19569

Closed
ZackerySpytz wants to merge 1 commit into
python:masterfrom
ZackerySpytz:bpo-32494-gdbm-count
Closed

bpo-32494: Add gdbm.count()#19569
ZackerySpytz wants to merge 1 commit into
python:masterfrom
ZackerySpytz:bpo-32494-gdbm-count

Conversation

@ZackerySpytz

@ZackerySpytz ZackerySpytz commented Apr 17, 2020

Copy link
Copy Markdown
Contributor

gdbm_count() was added in GDBM 1.11.

https://bugs.python.org/issue32494

gdbm_count() was added in GDBM 1.11.

@pitrou pitrou 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.

Thank you. This looks mostly good, just one comment.

Comment thread Modules/_gdbmmodule.c
{
gdbm_count_t count;
check_dbmobject_open(self);
if (gdbm_count(self->di_dbm, &count) == -1) {

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.

Need to set errno = 0 before this.

@bedevere-bot

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.

@corona10 corona10 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.

@ZackerySpytz @pitrou

Can we just replace the logic of dbm_length to use gdbm_count when the version is available?

dbm_length(dbmobject *dp)

if possible, we don't have to export a new method.

@pitrou

pitrou commented May 1, 2020

Copy link
Copy Markdown
Member

Superseded by PR #19814. Closing.

@pitrou pitrou closed this May 1, 2020
@sam-s sam-s mannequin mentioned this pull request Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants