fake-bpy-module icon indicating copy to clipboard operation
fake-bpy-module copied to clipboard

AddonPreferences.layout has a redundant `| None` in the type

Open Andrej730 opened this issue 1 year ago • 0 comments

Which leads to the issues in the draw() method:

import bpy
from typing import assert_type

class ADDON_preferences(bpy.types.AddonPreferences):
    def draw(self, context):
        # "assert_type" mismatch: expected "UILayout" but received "UILayout | None"
        assert_type(self.layout, bpy.types.UILayout)
        layout = self.layout
        # "box" is not a known attribute of "None"
        box = layout.box()
        # "row" is not a known attribute of "None"
        row = layout.row()

Andrej730 avatar Jul 01 '24 07:07 Andrej730