Skip to content

bpy.props.EnumProperty return type should be type[set[str]] when the 'ENUM_FLAG' option is enabled #4

Description

@Mysteryem

Currently bpy.props.EnumProperty is modified to have the return type-hint type[str], but it should also have type[set[str]] as a possible return. I'm not sure if an @overload can be added for the function since the options parameter is a set.

PyCharm seems to have some issues if these functions return Unions of types or types of Unions, but it might have been limited to Generic types, will have to try it and see. Might have to try a hacky 'amalgamation' class that extends both str and set[str] and setting the return type-hint to type[HackyAmalgamation]

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