Skip to content

Commit f0c199f

Browse files
authored
chore: un-deprecate SignalGroup.signals (#288)
* chore: undeprecate signals * test: fix test
1 parent b2ba976 commit f0c199f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/psygnal/_group.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,16 @@ class MySignals(SignalGroup):
359359

360360
@property
361361
def signals(self) -> Mapping[str, SignalInstance]:
362-
"""DEPRECATED: A mapping of signal names to SignalInstance instances."""
362+
"""A mapping of signal names to SignalInstance instances."""
363363
# TODO: deprecate this property
364-
warnings.warn(
365-
"Accessing the `signals` property on a SignalGroup is deprecated. "
366-
"Use __iter__ to iterate over all signal names, and __getitem__ or getattr "
367-
"to access signal instances. This will be an error in a future.",
368-
FutureWarning,
369-
stacklevel=2,
370-
)
371-
return self._psygnal_instances
364+
# warnings.warn(
365+
# "Accessing the `signals` property on a SignalGroup is deprecated. "
366+
# "Use __iter__ to iterate over all signal names, and __getitem__ or "
367+
# "getattr to access signal instances. This will be an error in a future.",
368+
# FutureWarning,
369+
# stacklevel=2,
370+
# )
371+
return MappingProxyType(self._psygnal_instances)
372372

373373
def __len__(self) -> int:
374374
"""Return the number of signals in the group (not including the relay)."""

src/psygnal/_signal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ def connect_setattr(
664664
"""
665665
if maxargs is _NULL:
666666
warnings.warn(
667-
"The default value of maxargs will change from `None` to `1` in"
667+
"The default value of maxargs will change from `None` to `1` in "
668668
"version 0.11. To silence this warning, provide an explicit value for "
669669
"maxargs (`None` for current behavior, `1` for future behavior).",
670670
FutureWarning,

tests/test_evented_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ class User(EventedModel):
6969

7070
# test event system
7171
assert isinstance(user.events, SignalGroup)
72-
with pytest.warns(FutureWarning):
73-
assert "id" in user.events.signals
74-
assert "name" in user.events.signals
72+
# with pytest.warns(FutureWarning):
73+
assert "id" in user.events.signals
74+
assert "name" in user.events.signals
7575

7676
# ClassVars are excluded from events
7777
assert "age" not in user.events

0 commit comments

Comments
 (0)