Skip to content

Commit

Permalink
Update type comments to type annotations (jazzband#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
terencehonles authored Nov 8, 2021
1 parent 7a2a377 commit 9cd2bbe
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,6 @@ jobs:
run: |
if ! towncrier check; then
echo ''
echo "Please add a description of your changes to 'changelog.d/{issue or PR number}.{feature,bugfix,removal}'"
echo "Please add a description of your changes to 'changelog.d/{issue or PR number}.{feature,bugfix,misc,doc,removal}'"
exit 1
fi
1 change: 1 addition & 0 deletions changelog.d/568.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update type comments to type annotations.
4 changes: 2 additions & 2 deletions django_redis/client/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, server, params: Dict[str, Any], backend: BaseCache) -> None:
if not isinstance(self._server, (list, tuple, set)):
self._server = self._server.split(",")

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

Expand Down Expand Up @@ -146,7 +146,7 @@ def set(
timeout = self._backend.default_timeout

original_client = client
tried = [] # type: List[int]
tried: List[int] = []
while True:
try:
if client is None:
Expand Down
2 changes: 1 addition & 1 deletion django_redis/hash_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class HashRing:
nodes = [] # type: List[str]
nodes: List[str] = []

def __init__(self, nodes: Iterable[str] = (), replicas: int = 128) -> None:
self.replicas: int = replicas
Expand Down
2 changes: 1 addition & 1 deletion django_redis/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ConnectionFactory:
# ConnectionFactory is instantiated, as Django creates new cache client
# (DefaultClient) instance for every request.

_pools = {} # type: Dict[str, Redis]
_pools: Dict[str, Redis] = {}

def __init__(self, options):
pool_cls_path = options.get(
Expand Down

0 comments on commit 9cd2bbe

Please sign in to comment.