chore: add PEP 484 type annotations to modifierservice.py#380
Open
yehorcallmedai-maker wants to merge 1 commit into
Open
Conversation
Contributor
|
Regarding the "Any" part... If installing the fake-bpy-module per the https://github.com/makehumancommunity/mpfb2/blob/master/requirements-dev.txt file, pyright accepts "bpy.types.Object" as type hint. Now, I'm new to pyright and haven't really done a lot of work with type hinting either. I'd love to hear your input on this. Is it a bad idea to rely on fake-bpy-module? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuing the type annotation pass from #377 (logservice.py) and #378 (systemservice.py).
What this changes
Adds PEP 484 type annotations to all 7 static methods in
ModifierService. No logic changes.blender_object/armature_object/ modifier return values typed asAny— bpy-stubs are not available at type-check time;Anyis the honest annotation that avoids false-positive attribute errorsmodifier_name,modifier_type,vertex_group→strshow_in_editmode,show_on_cage,move_to_top→boollevels,render_levels→intfrom typing import AnyimportPyright result
Baseline (before): 1 error, 0 warnings (
bpyimport unresolvable outside Blender)After: 1 error, 0 warnings — no regressions introduced