Skip to content

Fix pyright errors in node-factory.py #30205

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sanleo-wq
Copy link

Fixed the type handling in the _arguments_as_outputs method:

  • Used isinstance(argument, Output) instead of issubclass(type(argument), Output) for proper instance checking
  • Added explicit type cast for better type inference

Added proper type annotations and documentation:

  • Added docstring to the base add_extension method
  • Added explicit typing information to improve Pyright's type inference

Updated the corresponding stub file node_factory.pyi for consistency with the implementation:

  • Fixed type annotations in method signatures
  • Improved docstrings to match the implementation

These changes resolve the Pyright errors related to type inconsistencies and improve the overall type safety of the code.

Fixes #30153

@sanleo-wq sanleo-wq requested a review from a team as a code owner April 18, 2025 12:55
@github-actions github-actions bot added the category: Python API OpenVINO Python bindings label Apr 18, 2025
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Python API OpenVINO Python bindings ExternalPR External contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Fix pyright in: src/openvino/utils/node_factory.py
2 participants