I’m trying to make an addon that adds a wireframe tree to my scene, but whenever my script runs the bpy_extras.object_utils.object_data_add() function, I get a TypeError saying “'int object is not iterable”.
It looks like the property operator.layers itself is returning a number, while the any() builtin expects it to be an iterable, or sequence of objects.
any() is used to check the truth value of a sequence: if any of the objects in a sequence evaluates to True the function will return True. However an integer is a singular object, so any() doesn’t understand it.