Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UILayout.panel and UILayout.panel_prop are missing return value #315

Open
Andrej730 opened this issue Nov 17, 2024 · 0 comments
Open

UILayout.panel and UILayout.panel_prop are missing return value #315

Andrej730 opened this issue Nov 17, 2024 · 0 comments

Comments

@Andrej730
Copy link
Contributor

Andrej730 commented Nov 17, 2024

Documentation has return values for those methods - https://docs.blender.org/api/current/bpy.types.UILayout.html#bpy.types.UILayout.panel
image

But typing is missing them, see the snippet below.

import bpy
from typing import assert_type

class NewLayoutPanel(bpy.types.Panel):
    def draw(self, context):
        assert context
        scene = context.scene
        layout = self.layout

        header, panel = layout.panel_prop(scene, "use_extra_user")
        # "assert_type" mismatch: expected "UILayout" but received "Unknown"
        assert_type(header, bpy.types.UILayout)
        # "assert_type" mismatch: expected "UILayout | None" but received "Unknown"
        assert_type(panel, bpy.types.UILayout | None)
        header, panel = layout.panel("bridges", default_closed=True)
        # "assert_type" mismatch: expected "UILayout" but received "Unknown"
        assert_type(header, bpy.types.UILayout)
        # "assert_type" mismatch: expected "UILayout | None" but received "Unknown"
        assert_type(panel, bpy.types.UILayout | None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant