Skip to content

Commit 6b823e4

Browse files
refactor: use MISSING_TYPE and DEPRECATED for deprecated parameters
1 parent 07af7a8 commit 6b823e4

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

shiny/ui/_input_select.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from .._deprecated import warn_deprecated
6-
from ..types import Jsonifiable
6+
from ..types import Jsonifiable, MISSING_TYPE, DEPRECATED
77

88
__all__ = (
99
"input_select",
@@ -138,11 +138,11 @@ def input_select(
138138
*,
139139
selected: Optional[str | list[str]] = None,
140140
multiple: bool = False,
141-
selectize: bool = False,
141+
selectize: bool | MISSING_TYPE = DEPRECATED,
142142
width: Optional[str] = None,
143143
size: Optional[str] = None,
144-
remove_button: Optional[bool] = None,
145-
options: Optional[dict[str, Jsonifiable | JSEval]] = None,
144+
remove_button: Optional[bool] | MISSING_TYPE = DEPRECATED,
145+
options: Optional[dict[str, Jsonifiable | JSEval]] | MISSING_TYPE = DEPRECATED,
146146
) -> Tag:
147147
"""
148148
Create a select list that can be used to choose a single or multiple items from a
@@ -195,19 +195,25 @@ def input_select(
195195
* :func:`~shiny.ui.input_radio_buttons`
196196
* :func:`~shiny.ui.input_checkbox_group`
197197
"""
198-
if selectize:
198+
if isinstance(selectize, MISSING_TYPE):
199+
selectize = False
200+
else:
199201
warn_deprecated(
200202
"`selectize` parameter of `input_select()` is deprecated. "
201203
"Use `input_selectize()` instead of passing `selectize=True`."
202204
)
203205

204-
if remove_button is not None:
206+
if isinstance(remove_button, MISSING_TYPE):
207+
remove_button = None
208+
else:
205209
warn_deprecated(
206210
"`remove_button` parameter of `input_select()` is deprecated. "
207211
"Use `input_selectize()` instead."
208212
)
209213

210-
if options is not None:
214+
if isinstance(options, MISSING_TYPE):
215+
options = None
216+
else:
211217
warn_deprecated(
212218
"`options` parameter of `input_select()` is deprecated. "
213219
"Use `input_selectize()` instead."

0 commit comments

Comments
 (0)