Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
6.5.1
-
None
Description
Confirmed that this works fine in 6.5.0, but fails in 6.5.1. My code looks like this:
```
def bind_value_changing(top_level_dataclass: Any, all_parameters: Parameter) -> None:
def value_changing(parameter: Any, value: Any, top_level_dataclass=top_level_dataclass) -> Any:
print("Value changing", value_changing, parameter.name(), value,
def bind_signals(p: Parameter) -> None:
for child in p.children():
print("Binding", child.name(), value_changing, type(top_level_dataclass))
child.sigValueChanged.connect(value_changing)
bind_signals(child)
```
In this snippet, value_changing closes over top_level_dataclass. Thus, there are multiple versions of value_changing, each called by a different signal. Only in 6.5.1, it appears that these have all been collapsed into a single function.
Perhaps, there the signals are coalesced incorrectly? It is incorrect to coalesce functions by name since they can close over values. They can only be coalesced if they have the same id.
Attachments
Issue Links
- duplicates
-
PYSIDE-2346 Connecting signal to inner function reuses first instance of inner function
- Closed