Skip to content

Add missing type declarations for top-level files in src/openfermion#1300

Open
mhucka wants to merge 2 commits intoquantumlib:mainfrom
mhucka:add-type-hints-src-top
Open

Add missing type declarations for top-level files in src/openfermion#1300
mhucka wants to merge 2 commits intoquantumlib:mainfrom
mhucka:add-type-hints-src-top

Conversation

@mhucka
Copy link
Copy Markdown
Contributor

@mhucka mhucka commented May 6, 2026

This adds more type hints to the Python files at the top level of src/openfermion.

This partly addresses #1282.

@mhucka
Copy link
Copy Markdown
Contributor Author

mhucka commented May 6, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances type safety by adding type annotations to _compat.py, _compat_test.py, and conftest.py. Specifically, it introduces return type hints, argument types, and necessary type ignore comments for dynamic attributes, while also cleaning up unused imports. I have no feedback to provide.

@mhucka mhucka marked this pull request as ready for review May 6, 2026 23:03
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds type hints to _compat.py, _compat_test.py, and conftest.py to enhance static type checking. The changes include specifying return types for functions and methods, adding parameter types, and including type ignore comments for dynamic attribute assignments in tests. Additionally, an unused import was removed from the test suite. I have no feedback to provide.

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.

1 participant