Skip to content

Commit 2a0477c

Browse files
authored
better sentinel repr (#251)
1 parent 95d908b commit 2a0477c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

magicgui/widgets/_bases/value_widget.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99

1010
from .widget import Widget
1111

12-
UNSET = object()
12+
13+
class _Unset:
14+
def __repr__(self) -> str:
15+
return "UNSET"
16+
17+
18+
UNSET = _Unset()
1319

1420

1521
class ValueWidget(Widget):
@@ -18,13 +24,12 @@ class ValueWidget(Widget):
1824
Parameters
1925
----------
2026
value : Any, optional
21-
The starting value for the widget, by default ``None``
27+
The starting value for the widget.
2228
bind : Any, optional
2329
A value or callback to bind this widget, then whenever `widget.value` is
2430
accessed, the value provided here will be returned. ``value`` can be a
2531
callable, in which case ``value(self)`` will be returned (i.e. your callback
2632
must accept a single parameter, which is this widget instance.).
27-
2833
"""
2934

3035
_widget: _protocols.ValueWidgetProtocol

0 commit comments

Comments
 (0)