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

Fix mypy errors in src/codegen/gscli/backend/typestub_utils.py #993

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

codegen-sh[bot]
Copy link
Contributor

@codegen-sh codegen-sh bot commented Mar 31, 2025

This PR fixes mypy errors in the src/codegen/gscli/backend/typestub_utils.py file by:

  1. Adding proper type hints for functions and methods that handle AST nodes
  2. Using Union from typing instead of the pipe operator for better compatibility
  3. Adding type safety by checking if AST nodes are of the expected type before accessing attributes
  4. Adding a type variable for AST nodes to improve type checking
  5. Adding explicit type casting in the _strip_internal_symbols function

These changes improve type safety without changing the functionality of the code.

Note: This is a small PR focused only on fixing mypy errors in one file as requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants