Pass data to EnumPropery items callback I'm struggling to pass a variable to an EnumProperty items callback, resulting in making this variable a global, which I prefer to avoid. I want to be able to access the "plant" from the "model_callback", but I can't reference it as self.plant. I am unclear on the scope I'm running in within the callback.

Simplied example follows. Note that in the real example, the plant variable changes whenever the filepath is updated.

class ImportPlant(bpy.types.Operator, ImportHelper):
    bl_idname = "import_object.plant"
    bl_label = "Import Plant"
    # ...

    plant = ["spring", "summer"]

    def model_id_callback(self, context):
        items = []
        # Results in: AttributeError: 'IMPORT_OBJECT_OT_plant' object has no attribute 'plant'
        for model in self.plant:
            items.append((model, model, ""))
        return items

    model_id: EnumProperty(items=model_id_callback, name="Model")

    # ...


How can I access the plant variable in the model_id_callback without just making it a global?
The plant is a class attribute and not an instance attribute, meaning that each instance of the class ImportPlant references the same plant. Therefore your script should use ImportPlant.plant instead of self.plant.