-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Instead, type-only imports should be guarded using TYPE_CHECKING.
Description
NONE
Background and Context
No response
Current Code Analysis
No response
Issues Identified
No response
Problem
Currently, the project includes some code coverage related to type annotations. However, the current approach of importing type annotations at runtime is unnecessary, since they are only used by the editor for type hints and autocomplete. If there is no runtime type checking, these imports do not need to be evaluated at execution time.
Proposed Solution
from typing import List, Optional
# should be written as
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import List, OptionalImplementation Steps
No response
Acceptance Criteria
No response
Testing Checklist
No response
Benefits
No response
Alternatives Considered
No response
Related Documentation
No response
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request