Skip to content

Commit 5c48082

Browse files
committed
Deprecate the selected_from method
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent a964097 commit 5c48082

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/frequenz/channels/_select.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@
135135
from collections.abc import AsyncIterator
136136
from typing import Any, Generic, TypeGuard
137137

138+
from typing_extensions import deprecated
139+
138140
from ._exceptions import Error
139141
from ._generic import ReceiverMessageT_co
140142
from ._receiver import Receiver, ReceiverStoppedError
@@ -246,6 +248,7 @@ def __repr__(self) -> str:
246248
# It would have been nice to be able to make this a method of selected, but sadly
247249
# `TypeGuard`s can't be used as methods. For more information see:
248250
# https://github.com/microsoft/pyright/discussions/3125
251+
@deprecated("Use `Receiver.is_selected()` instead.")
249252
def selected_from(
250253
selected: Selected[Any], receiver: Receiver[ReceiverMessageT_co]
251254
) -> TypeGuard[Selected[ReceiverMessageT_co]]:

0 commit comments

Comments
 (0)