You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/migration.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -556,7 +556,7 @@ The session hierarchy now uses a new **runtime-checkable Protocol** called `Abst
556
556
557
557
Key characteristics of `AbstractBaseSession`:
558
558
1.**Pure Interface**: It is a structural protocol with no implementation state or `__init__` method.
559
-
2.**Simplified Type Parameters**: It takes two parameters: `AbstractBaseSession[SendRequestT, SendNotificationT]`. Contravariant variance is used for these parameters to ensure that sessions can be used safely in generic contexts (like `RequestContext`).
559
+
2.**Simplified Type Parameters**: It takes two parameters: `AbstractBaseSession[SendRequestT_contra, SendNotificationT_contra]`. Contravariant variance is used for these parameters to ensure that sessions can be used safely in generic contexts (like `RequestContext`).
560
560
3.**BaseSession Implementation**: The concrete implementation logic (state management, response routing) is provided by the `BaseSession` class, which satisfies the protocol.
561
561
562
562
**Before:**
@@ -580,9 +580,9 @@ class MySession(AbstractBaseSession[...]):
580
580
self._my_state = {}
581
581
```
582
582
583
-
#### `SendRequestT`changed to contravariant
583
+
#### `SendRequestT`renamed to `SendRequestT_contra`
584
584
585
-
The `SendRequestT` TypeVar is now defined as **contravariant** to support its use in the `AbstractBaseSession` Protocol.
585
+
The `SendRequestT` TypeVar is now defined as **contravariant** to support its use in the `AbstractBaseSession` Protocol and renamed accordingly to follow naming conventions for contravariant type variables.
#### `SendNotificationT`renamed to `SendNotificationT_contra`
600
600
601
-
The `SendNotificationT` TypeVar is now defined as **contravariant** to support its use in the `AbstractBaseSession` Protocol.
601
+
The `SendNotificationT` TypeVar is now defined as **contravariant** to support its use in the `AbstractBaseSession` Protocol and renamed accordingly to follow naming conventions for contravariant type variables.
#### `ReceiveResultT`renamed to `ReceiveResultT_co`
618
618
619
-
The `ReceiveResultT` TypeVar is now defined as **covariant** to support its use in the `AbstractBaseSession` Protocol.
619
+
The `ReceiveResultT` TypeVar is now defined as **covariant** to support its use in the `AbstractBaseSession` Protocol and renamed accordingly to follow naming conventions for covariant type variables.
0 commit comments