Add strict mode to pyright (#315)
* Add strict mode to pyright * Apply UP rule * fix readme * More correct * Leave wrong Context for now * Add strict mode to pyright * Apply UP rule * fix readme * fix * ignore
This commit is contained in:
parent
5a54d82459
commit
ae77772ea8
1 changed files with 194 additions and 133 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from collections.abc import Callable
|
||||
from typing import (
|
||||
Annotated,
|
||||
Any,
|
||||
Callable,
|
||||
Generic,
|
||||
Literal,
|
||||
TypeAlias,
|
||||
|
|
@ -89,6 +89,7 @@ class Notification(BaseModel, Generic[NotificationParamsT, MethodT]):
|
|||
"""Base class for JSON-RPC notifications."""
|
||||
|
||||
method: MethodT
|
||||
params: NotificationParamsT
|
||||
model_config = ConfigDict(extra="allow")
|
||||
|
||||
|
||||
|
|
@ -1010,7 +1011,9 @@ class CancelledNotificationParams(NotificationParams):
|
|||
model_config = ConfigDict(extra="allow")
|
||||
|
||||
|
||||
class CancelledNotification(Notification):
|
||||
class CancelledNotification(
|
||||
Notification[CancelledNotificationParams, Literal["notifications/cancelled"]]
|
||||
):
|
||||
"""
|
||||
This notification can be sent by either side to indicate that it is cancelling a
|
||||
previously-issued request.
|
||||
|
|
|
|||
Loading…
Reference in a new issue