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

Replace ForwardRef with TYPE_CHECKING #310

Merged
merged 2 commits into from
Dec 26, 2023
Merged

Conversation

RLKRo
Copy link
Member

@RLKRo RLKRo commented Dec 19, 2023

Description

When type import would cause cyclic import error, instead of defining types as ForwardRefs or pydantic's BaseModels, use TYPE_CHECKING.

This helps tools that work with typing such as mypy (this PR reduces the number of errors found with mypy from 208 to 145).

Checklist

  • I have performed a self-review of the changes

To Consider

  • Add tests (if functionality is changed)
  • Update API reference / tutorials / guides
  • Update CONTRIBUTING.md (if devel workflow is changed)
  • Update .ignore files, scripts (such as lint), distribution manifest (if files are added/deleted)
  • Search for references to changed entities in the codebase

@RLKRo RLKRo added the refactor/style No changes to functionalty label Dec 19, 2023
@RLKRo RLKRo force-pushed the refactor/use_type_checking branch from a5b3c22 to ce63b2c Compare December 20, 2023 08:53
@RLKRo RLKRo requested a review from pseusys December 25, 2023 08:15
@RLKRo RLKRo merged commit fec2143 into dev Dec 26, 2023
17 checks passed
@RLKRo RLKRo deleted the refactor/use_type_checking branch December 26, 2023 20:05
@RLKRo RLKRo mentioned this pull request Jan 10, 2024
5 tasks
@RLKRo RLKRo mentioned this pull request Mar 1, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor/style No changes to functionalty
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants