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

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

Open
Mysteryem opened this issue Jan 2, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Mysteryem
Copy link
Owner

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.

@Mysteryem Mysteryem added the bug Something isn't working label Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant