Python changing attribute mystery. Help?

Win-Vector Blog 2019-12-07

Python peeps: any idea why this attribute changes value when I re-examine it? I am using PyCharm, but the calculation is weird even in Jupyter.

It doesn’t just seem to be the debugger, running it in Jupyter gives the wrong value (just {'x'}, instead of {'x', 'y'}). The type appears to be a dictionary object as an attribute of a class, but the field is acting strange.

The error is triggered here.