python-apt's apt.Cache should be more like a dict

Bug #251587 reported by to be removed
0
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Wishlist
Michael Vogt

Bug Description

Binary package hint: python-apt

Attached is a small Python program to display the problem: apt.Cache does not support '"foo" in cache' even though it tries to be a dict. The output of the program should be four times True, now the second line is False. I think that is a bug.

Fixing this should be possible by just adding a __contains__(self, item) method to apt.Cache, possibly as an alias for has_key.

(I'm currently using version 0.7.6ubuntu3~ppa1 of python-apt.)

Also, isn't it time to make python-apt _not_ complain about the API being unstable? Pretty please?

Revision history for this message
to be removed (liw) wrote :
Michael Vogt (mvo)
Changed in python-apt:
assignee: nobody → mvo
importance: Undecided → Wishlist
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.7.7.1ubuntu2

---------------
python-apt (0.7.7.1ubuntu2) intrepid; urgency=low

  * python/cache.cc:
    - fix GetCandidateVer() reporting incorrect versions after
      SetCandidateVer() was used. Thanks to Julian Andres Klode for
      the test-case (LP: #237372)
  * python/apt_instmodule.cc:
    - do not change working dir in debExtractArchive() (LP: #184093)
  * apt/cache.py:
    - support "in" in apt.Cache() (LP: #251587)

 -- Michael Vogt <email address hidden> Tue, 05 Aug 2008 11:35:32 +0200

Changed in python-apt:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.