abderrahim commented on code in PR #2167:
URL: https://github.com/apache/buildstream/pull/2167#discussion_r3774207018


##########
src/buildstream/_loader/loadcontext.py:
##########
@@ -14,23 +14,31 @@
 #  Authors:
 #        Tristan Van Berkom <[email protected]>
 
+
+from typing import Callable, Optional, TYPE_CHECKING
+
+
 from .._exceptions import LoadError
 from ..exceptions import LoadErrorReason
 from ..types import _ProjectInformation
 
+if TYPE_CHECKING:
+    from .._context import Context
+    from .._loader.loader import Loader
+
 
 # ProjectLoaders()
 #
 # An object representing all of the loaders for a given project.
 #
 class ProjectLoaders:
-    def __init__(self, project_name):
+    def __init__(self, project_name: str):
 
         # The project name
         self._name = project_name
 
         # A list of all loaded loaders for this project
-        self._collect = []
+        self._collect: list["Loader"] = []

Review Comment:
   We don't want to rely on `from __future__ import annotations` since it's 
going away, but if the code can be made to work with it for python < 3.14, and 
with the native lazy annotations support in python 3.14, then it should be 
fine. We can import it conditionally.
   
   But let's please try to keep changes to a minimum. If you want to do this, 
please do it separately.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to