Skip to content

Commit 06629c3

Browse files
committed
Add missing docstrings to classes
1 parent 3115bf2 commit 06629c3

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/eve_api/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class EVEClient:
3939
"""
4040

4141
_DEFAULT_TIMEOUT = 30.0
42+
_SSE_DONE_SENTINEL = "[DONE]"
4243

4344
def __init__(
4445
self,
@@ -260,9 +261,7 @@ async def stream(
260261
if not line or not line.startswith("data: "):
261262
continue
262263

263-
if ( # pylint: disable=magic-value-comparison
264-
data_str := line[6:]
265-
) == "[DONE]":
264+
if (data_str := line[6:]) == self._SSE_DONE_SENTINEL:
266265
return
267266

268267
try:

tests/test_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,30 @@
2121

2222

2323
class StatusEvent(TypedDict):
24+
"""SSE event emitted while the server is still working."""
25+
2426
type: Literal["status"]
2527
content: str
2628

2729

2830
class TokenEvent(TypedDict):
31+
"""SSE event carrying an incremental token of the streamed response."""
32+
2933
type: Literal["token"]
3034
content: str
3135

3236

3337
class FinalEvent(TypedDict):
38+
"""SSE event marking the final, complete response."""
39+
3440
type: Literal["final"]
3541
content: str
3642
message_id: str
3743

3844

3945
class ErrorEvent(TypedDict):
46+
"""SSE event indicating the stream terminated with an error."""
47+
4048
type: Literal["error"]
4149
content: str
4250

0 commit comments

Comments
 (0)