Skip to content

[Feature]: Improve the import times. #148

@Jatinbhardwaj-093

Description

@Jatinbhardwaj-093

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, Optional

Implementation 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions