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 gvanrossum, jafo, jcea, johansen
Date 2008-03-24.22:46:48
SpamBayes Score 0.03900324
Marked as misclassified No
Message-id <1206398810.02.0.209688033348.issue2159@psf.upfronthosting.co.za>
In-reply-to
Content
I think that "-1" is a sanity check. If the count is updated in the
database, but it is not transactional (or there are bugs, or the DB is
updated by a not up-to-date library, and so on), the cached counter and
the real data can diverge.

Anybody using "Berkeley DB" related databases knows that "length" is
costly. By good reasons, actually :-).

Checking for empty databases should be fast, nevertheless (just iterate
over the first item in the database). We could simply define a
"__nonzero__()" method for that. That would solve the "if" issue.
History
Date User Action Args
2008-03-24 22:46:50jceasetspambayes_score: 0.0390032 -> 0.03900324
recipients: + jcea, gvanrossum, jafo, johansen
2008-03-24 22:46:50jceasetspambayes_score: 0.0390032 -> 0.0390032
messageid: <1206398810.02.0.209688033348.issue2159@psf.upfronthosting.co.za>
2008-03-24 22:46:49jcealinkissue2159 messages
2008-03-24 22:46:48jceacreate