/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/lru_cache.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from . import (
22
22
    trace,
23
23
    )
24
 
from .sixish import (
25
 
    viewitems,
26
 
    viewkeys,
27
 
    )
28
24
 
29
25
 
30
26
_null_key = object()
136
132
        :return: An unordered list of keys that are currently cached.
137
133
        """
138
134
        # GZ 2016-06-04: Maybe just make this return the view?
139
 
        return list(viewkeys(self._cache))
 
135
        return list(self._cache.keys())
140
136
 
141
137
    def as_dict(self):
142
138
        """Get a new dict with the same key:value pairs as the cache"""
143
 
        return dict((k, n.value) for k, n in viewitems(self._cache))
 
139
        return dict((k, n.value) for k, n in self._cache.items())
144
140
 
145
141
    def cleanup(self):
146
142
        """Clear the cache until it shrinks to the requested size.