This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jcea
Recipients eolson, jafo, jcea, johansen, ysj.ray
Date 2014-04-23.22:38:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1398292711.28.0.24029909628.issue2159@psf.upfronthosting.co.za>
In-reply-to
Content
First, Python 2.4 has been out of support for a really long time. Deleting.

Eric, let me clarify the situation, because this report is old and I forgot the details.

I think current situation is this, when doing something like "if db : DO_SOMETHING":

a) If the database is closed, raise an exception.

b) If database is empty, returns False.

c) If database has any entry, returns True. Takes time proportional to database length, because it is going to go thru it.

The patch you are proposing:

a) If the database is closed, raise an exception.

b) If database is empty, returns 0.

c) If database has any entry, returns 1. Fast and simply checking if the database has at least a single record.

Why 0/1 instead of True/False?. This is going to be a 3.5 patch, True/False are really there, they are not aliases.

PS: When done, I will probably port this patch to current "pybsddb" work, although I am not sure that Berkeley DB has "firstkey" for all database types it support. Would you allow this porting, Eric? https://pypi.python.org/pypi/bsddb3/6.0.1
History
Date User Action Args
2014-04-23 22:38:31jceasetrecipients: + jcea, jafo, johansen, ysj.ray, eolson
2014-04-23 22:38:31jceasetmessageid: <1398292711.28.0.24029909628.issue2159@psf.upfronthosting.co.za>
2014-04-23 22:38:31jcealinkissue2159 messages
2014-04-23 22:38:30jceacreate