Same code but different results in GH Python3 and Python 2 components

Not sure if it’s a bug, but when I try to filter input values, it gets different result in python3 component.
The code is pretty simple:

if x%2 == 0:
a = x
else:
b = x

Hi @tpuaup,

The attached seems to work as expected.

test_modulus.gh (11.5 KB)

– Dale

1 Like

@tpuaup Currently Grasshopper keeps the python scopes around between component runs and the previous value set to either a or b will be captured on the output. As in Dale’s example, assigning None to a or b explicitly solved the problem. But I see where the bug is and will fix that for 8.4

RH-79615 Unset outputs will use the persistent value from previous runs

1 Like

RH-79615 is fixed in Rhino 8 Service Release 4 Release Candidate

1 Like