nutti / fake-bpy-module

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

Enum value should only be type str not str | int #213

Closed JonathanPlasse closed 4 months ago

JonathanPlasse commented 4 months ago

Expected behavior

Enum in Blender can either be str or int but should ideally only be str not int. The integer value is part of the internals of Blender and is not part of the documentation. The integer value could change meaning between Blender version and thus break. With the string value, it should happen much less often or never. That is why it is recommended to use only string value. I think we should reflect this in the pyi files and only accept string value for enum value. This is inline with the idea of type checking with fake-bpy-module to make code more robust.

nutti commented 4 months ago

@JonathanPlasse

I agreed this idea. I'll check your PR from now.