File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed
Expand file tree Collapse file tree 5 files changed +9
-9
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
3229 # Local imports
@@ -271,7 +268,6 @@ def get_activity_log_list(
271268 return cast (JSONDict , result )
272269
273270 # Return as iterator if requested
274- # We use string literal type annotation 'PaginatedIterator' to avoid circular imports
275271 if as_iterator :
276272 return create_paginated_iterator (
277273 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 :
22+ # Local imports - only imported during type checking
2123 # Local imports
2224 from fitbit_client .resources .pagination import PaginatedIterator
2325
@@ -128,7 +130,6 @@ def get_ecg_log_list(
128130 return cast (JSONDict , result )
129131
130132 # Return as iterator if requested
131- # We use TYPE_CHECKING for PaginatedIterator type to avoid circular imports
132133 if as_iterator :
133134 return create_paginated_iterator (
134135 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 :
20+ # Local imports - only imported during type checking
1921 # Local imports
2022 from fitbit_client .resources .pagination import PaginatedIterator
2123
@@ -129,7 +131,6 @@ def get_irn_alerts_list(
129131 return cast (JSONDict , result )
130132
131133 # Return as iterator if requested
132- # We use TYPE_CHECKING for PaginatedIterator type to avoid circular imports
133134 if as_iterator :
134135 return create_paginated_iterator (
135136 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 - only imported during type checking
2223 # Local imports
2324 from fitbit_client .resources .base import BaseResource
2425
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 :
24+ # Local imports - only imported during type checking
2325 # Local imports
2426 from fitbit_client .resources .pagination import PaginatedIterator
2527
@@ -391,7 +393,6 @@ def get_sleep_log_list(
391393 return cast (JSONDict , result )
392394
393395 # Return as iterator if requested
394- # We use TYPE_CHECKING for PaginatedIterator type to avoid circular imports
395396 if as_iterator :
396397 return create_paginated_iterator (
397398 response = cast (JSONDict , result ),
You can’t perform that action at this time.
0 commit comments