nutti / fake-bpy-module

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

override_context parameter of bpy.ops.* functions is not fully typed #180

Closed arcusmaximus closed 4 months ago

arcusmaximus commented 8 months ago

Calling any function in bpy.ops gives me a type error with VS Code's Pyright in strict mode. The reason is that the override_context parameter is typed as typing.Optional[typing.Union[typing.Dict, 'bpy.types.Context']] with the typing.Dict missing its generic parameters. Extending it to typing.Dict[str, typing.Any] would solve the error.

image

The same goes for the return values of bmesh.ops.*

nutti commented 4 months ago

This issue is fixed.

The same goes for the return values of bmesh.ops.*

This is wrong. bmesh.ops* does not accept override related parameters.

arcusmaximus commented 4 months ago

I mean the return types of bmesh.ops.*, not the parameters. For example, bmesh.ops.create_uvsphere() is declared with a return type of Dict without further details.

nutti commented 4 months ago

@arcusmaximus

I misunderstood your report. The other issue is also fixed now.