# What’s New In python-apt 1.7

## Changed

- Starting with 1.6.1 and 1.7~alpha1, the exception raised when passing objects of a different cache to `apt_pkg.DepCache` is `apt_pkg.CacheMismatchError`, and `apt.cache.Cache` will automatically remap open packages and versions to a new cache.

- `apt_pkg.Policy.get_priority()` now accepts `apt_pkg.Version` objects in addition to `apt_pkg.Package` and `apt_pkg.PackageFile` ones.

- `apt.package.Version.policy_priority` now returns the priority for that version rather than the highest priority for one of its package files.

- `apt.Cache.commit()` and `apt_pkg.DepCache.commit()` now use frontend locking to run dpkg.

## Added

- The class `apt_pkg.PackageRecords` can now lookup custom fields using `records[key]` and `key in records`.

- All code is now statically typed. Some methods from `apt_pkg` and `apt_inst` might still be missing or more strict than necessary.

- A new method `apt.cache.Cache.fix_broken()` has been added.

- New methods for frontend locking have been added: `apt_pkg.pkgsystem_lock_inner()`, `apt_pkg.pkgsystem_unlock_inner()`, `apt_pkg.pkgsystem_is_locked()` (starting in alpha 3).

## Deprecated

- `apt_pkg.Policy.get_priority()` accepting `apt_pkg.Package` is deprecated.