Skip to content

Commit

Permalink
Merge branch 'fix-root-validators' of https://github.com/tlambert03/p…
Browse files Browse the repository at this point in the history
…sygnal into fix-root-validators
  • Loading branch information
tlambert03 committed Sep 18, 2023
2 parents b6c4562 + 267a1ae commit 8e6faec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/psygnal/_evented_model_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def __setattr__(self, name: str, value: Any) -> None:

# grab current value
before = getattr(self, name, object())
# if we have any dependent properties, we need to grab their values
# if we have any dependent attributes, we need to grab their values
# before we set the new value, so that we can emit events for them
# after the new value is set (only if they have changed).
deps_before: Dict[str, Any] = {
Expand Down
4 changes: 2 additions & 2 deletions src/psygnal/_evented_model_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def __setattr__(self, name: str, value: Any) -> None:

# grab current value
before = getattr(self, name, object())
# if we have any dependent properties, we need to grab their values
# if we have any dependent attributes, we need to grab their values
# before we set the new value, so that we can emit events for them
# after the new value is set (only if they have changed).
deps_before: Dict[str, Any] = {
Expand All @@ -357,7 +357,7 @@ def __setattr__(self, name: str, value: Any) -> None:
if not _check_field_equality(type(self), name, after, before):
signal_instance.emit(after) # emit event

# also emit events for any dependent computed property setters as well
# also emit events for any dependent attributes as well
for dep, before_val in deps_before.items():
after_val = getattr(self, dep)
if not _check_field_equality(type(self), dep, after_val, before_val):
Expand Down

0 comments on commit 8e6faec

Please sign in to comment.