diff options
author | Thomas Kemmer <tkemmer@computer.org> | 2021-04-27 07:31:10 +0200 |
---|---|---|
committer | Thomas Kemmer <tkemmer@computer.org> | 2021-04-27 11:16:48 +0200 |
commit | a34c227c26070f546b4201745d826b3266801c1f (patch) | |
tree | a9ae2f1d6507986adcf311fa675f1f12ad5a3b12 | |
parent | 187b13a6da3e04511f3ed0c59889597edaec7f04 (diff) | |
download | cachetools-a34c227c26070f546b4201745d826b3266801c1f.tar.gz |
Remove Python 2 remnants.
-rw-r--r-- | cachetools/cache.py | 2 | ||||
-rw-r--r-- | cachetools/ttl.py | 6 | ||||
-rw-r--r-- | tests/__init__.py | 2 | ||||
-rw-r--r-- | tests/test_func.py | 2 | ||||
-rw-r--r-- | tests/test_method.py | 4 | ||||
-rw-r--r-- | tests/test_wrapper.py | 6 |
6 files changed, 11 insertions, 11 deletions
diff --git a/cachetools/cache.py b/cachetools/cache.py index 0c81d06..973d50b 100644 --- a/cachetools/cache.py +++ b/cachetools/cache.py @@ -1,7 +1,7 @@ from collections.abc import MutableMapping -class _DefaultSize(object): +class _DefaultSize: __slots__ = () diff --git a/cachetools/ttl.py b/cachetools/ttl.py index 72f6d52..eef8877 100644 --- a/cachetools/ttl.py +++ b/cachetools/ttl.py @@ -4,7 +4,7 @@ import time from .cache import Cache -class _Link(object): +class _Link: __slots__ = ("key", "expire", "next", "prev") @@ -22,7 +22,7 @@ class _Link(object): next.prev = prev -class _Timer(object): +class _Timer: def __init__(self, timer): self.__timer = timer self.__nesting = 0 @@ -143,7 +143,7 @@ class TTLCache(Cache): def currsize(self): with self.__timer as time: self.expire(time) - return super(TTLCache, self).currsize + return super().currsize @property def timer(self): diff --git a/tests/__init__.py b/tests/__init__.py index bfd5ec6..35ac81a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,7 +2,7 @@ import sys import unittest -class CacheTestMixin(object): +class CacheTestMixin: Cache = None diff --git a/tests/test_func.py b/tests/test_func.py index 721d5a6..72e7589 100644 --- a/tests/test_func.py +++ b/tests/test_func.py @@ -3,7 +3,7 @@ import unittest import cachetools.func -class DecoratorTestMixin(object): +class DecoratorTestMixin: def decorator(self, maxsize, **kwargs): return self.DECORATOR(maxsize, **kwargs) diff --git a/tests/test_method.py b/tests/test_method.py index 235eca4..b41dac0 100644 --- a/tests/test_method.py +++ b/tests/test_method.py @@ -4,7 +4,7 @@ import unittest from cachetools import LRUCache, cachedmethod, keys -class Cached(object): +class Cached: def __init__(self, cache, count=0): self.cache = cache self.count = count @@ -26,7 +26,7 @@ class Cached(object): raise TypeError("unhashable type") -class Locked(object): +class Locked: def __init__(self, cache): self.cache = cache self.count = 0 diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index e154ff8..37af16b 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py @@ -4,7 +4,7 @@ import cachetools import cachetools.keys -class DecoratorTestMixin(object): +class DecoratorTestMixin: def cache(self, minsize): raise NotImplementedError @@ -76,7 +76,7 @@ class DecoratorTestMixin(object): self.assertEqual(len(cache), 3) def test_decorator_lock(self): - class Lock(object): + class Lock: count = 0 @@ -114,7 +114,7 @@ class CacheWrapperTest(unittest.TestCase, DecoratorTestMixin): self.assertEqual(len(cache), 0) def test_zero_size_cache_decorator_lock(self): - class Lock(object): + class Lock: count = 0 |