Skip to content

Commit 9cd2bbe

Browse files
Update type comments to type annotations (#568)
1 parent 7a2a377 commit 9cd2bbe

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,6 @@ jobs:
179179
run: |
180180
if ! towncrier check; then
181181
echo ''
182-
echo "Please add a description of your changes to 'changelog.d/{issue or PR number}.{feature,bugfix,removal}'"
182+
echo "Please add a description of your changes to 'changelog.d/{issue or PR number}.{feature,bugfix,misc,doc,removal}'"
183183
exit 1
184184
fi

changelog.d/568.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update type comments to type annotations.

django_redis/client/default.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, server, params: Dict[str, Any], backend: BaseCache) -> None:
4242
if not isinstance(self._server, (list, tuple, set)):
4343
self._server = self._server.split(",")
4444

45-
self._clients = [None] * len(self._server) # type: List[Optional[Redis]]
45+
self._clients: List[Optional[Redis]] = [None] * len(self._server)
4646
self._options = params.get("OPTIONS", {})
4747
self._replica_read_only = self._options.get("REPLICA_READ_ONLY", True)
4848

@@ -146,7 +146,7 @@ def set(
146146
timeout = self._backend.default_timeout
147147

148148
original_client = client
149-
tried = [] # type: List[int]
149+
tried: List[int] = []
150150
while True:
151151
try:
152152
if client is None:

django_redis/hash_ring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class HashRing:
7-
nodes = [] # type: List[str]
7+
nodes: List[str] = []
88

99
def __init__(self, nodes: Iterable[str] = (), replicas: int = 128) -> None:
1010
self.replicas: int = replicas

django_redis/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ConnectionFactory:
1717
# ConnectionFactory is instantiated, as Django creates new cache client
1818
# (DefaultClient) instance for every request.
1919

20-
_pools = {} # type: Dict[str, Redis]
20+
_pools: Dict[str, Redis] = {}
2121

2222
def __init__(self, options):
2323
pool_cls_path = options.get(

0 commit comments

Comments
 (0)