Skip to content

Properties such as Mesh.shape_keys can be None, so should be Optional #12

Description

@Mysteryem

Some properties can be None and this should be indicated by declaring them with typing.Optional.

Properties do have an is_never_none attribute, but it's mostly used for properties that have an equivalent 'falsey' value, such as string properties that will be '' when there is no value set. Additionally, is_never_none can't be trusted, since bpy.types.Object.image_user has is_never_none, yet can actually be None.

I don't know if there's actually a way to tell if a property is optional. The is_required attribute sounds promising, but appears to only be used for function parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions