Minor type annotation improvements.

This commit is contained in:
Itamar Turner-Trauring 2022-04-14 11:45:47 -04:00
parent 2bc8cdf852
commit 9db5a397e1
2 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,8 @@
HTTP client that talks to the HTTP storage server.
"""
from __future__ import annotations
from typing import Union, Set, Optional
from base64 import b64encode
@ -214,7 +216,7 @@ class StorageClient(object):
self._treq = treq
@classmethod
def from_nurl(cls, nurl: DecodedURL, reactor, persistent: bool = True) -> "StorageClient":
def from_nurl(cls, nurl: DecodedURL, reactor, persistent: bool = True) -> StorageClient:
"""
Create a ``StorageClient`` for the given NURL.

View File

@ -27,7 +27,7 @@ def get_content_type(headers: Headers) -> Optional[str]:
return content_type
def swissnum_auth_header(swissnum): # type: (bytes) -> bytes
def swissnum_auth_header(swissnum: bytes) -> bytes:
"""Return value for ``Authentication`` header."""
return b"Tahoe-LAFS " + b64encode(swissnum).strip()