File tree Expand file tree Collapse file tree 5 files changed +9
-14
lines changed
Expand file tree Collapse file tree 5 files changed +9
-14
lines changed Original file line number Diff line number Diff line change 2323from fitbit_client .utils .types import JSONList
2424from fitbit_client .utils .types import ParamDict
2525
26- # We use TYPE_CHECKING to avoid circular imports at runtime.
27- # PaginatedIterator is only needed for type annotations, not for runtime code.
28- # This pattern is recommended by the Python typing documentation:
29- # https://docs.python.org/3/library/typing.html#typing.TYPE_CHECKING
26+ # Use TYPE_CHECKING to avoid circular imports
3027if TYPE_CHECKING :
3128 # Local imports - only imported during type checking
32- # Local imports
3329 from fitbit_client .resources .pagination import PaginatedIterator
3430
3531
@@ -271,7 +267,6 @@ def get_activity_log_list(
271267 return cast (JSONDict , result )
272268
273269 # Return as iterator if requested
274- # We use string literal type annotation 'PaginatedIterator' to avoid circular imports
275270 if as_iterator :
276271 return create_paginated_iterator (
277272 response = cast (JSONDict , result ),
Original file line number Diff line number Diff line change 1717from fitbit_client .utils .types import JSONDict
1818from fitbit_client .utils .types import ParamDict
1919
20+ # Use TYPE_CHECKING to avoid circular imports
2021if TYPE_CHECKING :
21- # Local imports
22+ # Local imports - only imported during type checking
2223 from fitbit_client .resources .pagination import PaginatedIterator
2324
2425
@@ -128,7 +129,6 @@ def get_ecg_log_list(
128129 return cast (JSONDict , result )
129130
130131 # Return as iterator if requested
131- # We use TYPE_CHECKING for PaginatedIterator type to avoid circular imports
132132 if as_iterator :
133133 return create_paginated_iterator (
134134 response = cast (JSONDict , result ),
Original file line number Diff line number Diff line change 1515from fitbit_client .utils .types import JSONDict
1616from fitbit_client .utils .types import ParamDict
1717
18+ # Use TYPE_CHECKING to avoid circular imports
1819if TYPE_CHECKING :
19- # Local imports
20+ # Local imports - only imported during type checking
2021 from fitbit_client .resources .pagination import PaginatedIterator
2122
2223
@@ -129,7 +130,6 @@ def get_irn_alerts_list(
129130 return cast (JSONDict , result )
130131
131132 # Return as iterator if requested
132- # We use TYPE_CHECKING for PaginatedIterator type to avoid circular imports
133133 if as_iterator :
134134 return create_paginated_iterator (
135135 response = cast (JSONDict , result ),
Original file line number Diff line number Diff line change 1717# Set up logging
1818logger = logging .getLogger (__name__ )
1919
20- # Avoid circular imports
20+ # Use TYPE_CHECKING to avoid circular imports
2121if TYPE_CHECKING :
22- # Local imports
22+ # Local imports - only imported during type checking
2323 from fitbit_client .resources .base import BaseResource
2424
2525
Original file line number Diff line number Diff line change 1919from fitbit_client .utils .types import JSONDict
2020from fitbit_client .utils .types import ParamDict
2121
22+ # Use TYPE_CHECKING to avoid circular imports
2223if TYPE_CHECKING :
23- # Local imports
24+ # Local imports - only imported during type checking
2425 from fitbit_client .resources .pagination import PaginatedIterator
2526
2627
@@ -391,7 +392,6 @@ def get_sleep_log_list(
391392 return cast (JSONDict , result )
392393
393394 # Return as iterator if requested
394- # We use TYPE_CHECKING for PaginatedIterator type to avoid circular imports
395395 if as_iterator :
396396 return create_paginated_iterator (
397397 response = cast (JSONDict , result ),
You can’t perform that action at this time.
0 commit comments