nutti / fake-bpy-module

Fake Blender Python API module collection for the code completion.
MIT License
1.42k stars 98 forks source link

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

Closed Andrej730 closed 4 months ago

Andrej730 commented 5 months ago

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()
nutti commented 4 months ago

This should be handled with #254.