Skip to content

Commit ec5c8dd

Browse files
committed
fix: typing for context generator
1 parent 3cc506a commit ec5c8dd

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/checkedid/client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Dict
33
from typing import List
44
from typing import Optional
5+
from typing import Self
56
from typing import Type
67
from typing import TypeVar
78

@@ -141,7 +142,7 @@ def map_exception(self, response: Response) -> Type[errors.CheckedIDError]:
141142
class ClientAsync(Client):
142143
"""for asyncio"""
143144

144-
def create_client(self, base_url):
145+
def create_client(self, base_url) -> None:
145146
self.client = httpx.AsyncClient(base_url=base_url)
146147

147148
async def dossier(self, dossier_number: str) -> endpoints.DossierEndpoint.response:
@@ -151,17 +152,17 @@ async def dossier(self, dossier_number: str) -> endpoints.DossierEndpoint.respon
151152

152153
return self.process_response(response, endpoints.DossierEndpoint.response)
153154

154-
def close(self):
155+
def close(self) -> None:
155156
self.client.aclose()
156157

157-
def open(self):
158+
def open(self) -> None:
158159
self.create_client(self.base_url)
159160

160-
def __enter__(self):
161+
def __enter__(self) -> Self:
161162
"""Open the httpx client"""
162163
self.open()
163164
return self
164165

165-
def __exit__(self, exc_type, exc_val, exc_tb):
166+
def __exit__(self, exc_type, exc_val, exc_tb) -> None:
166167
"""Close the httpx client"""
167168
self.close()

0 commit comments

Comments
 (0)