Use inline type hints in handlers/ and rest/. (#10382)

This commit is contained in:
Jonathan de Jong 2021-07-16 19:22:36 +02:00 committed by GitHub
parent 36dc15412d
commit 98aec1cc9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 212 additions and 215 deletions

View file

@ -97,7 +97,7 @@ class RemoteKey(DirectServeJsonResource):
async def _async_render_GET(self, request):
if len(request.postpath) == 1:
(server,) = request.postpath
query = {server.decode("ascii"): {}} # type: dict
query: dict = {server.decode("ascii"): {}}
elif len(request.postpath) == 2:
server, key_id = request.postpath
minimum_valid_until_ts = parse_integer(request, "minimum_valid_until_ts")
@ -141,7 +141,7 @@ class RemoteKey(DirectServeJsonResource):
time_now_ms = self.clock.time_msec()
# Note that the value is unused.
cache_misses = {} # type: Dict[str, Dict[str, int]]
cache_misses: Dict[str, Dict[str, int]] = {}
for (server_name, key_id, _), results in cached.items():
results = [(result["ts_added_ms"], result) for result in results]