================
@@ -3872,23 +3886,23 @@ class File(ClangObject):
     """
 
     @staticmethod
-    def from_name(translation_unit, file_name):
+    def from_name(translation_unit: TranslationUnit, file_name: StrBytesPath) 
-> File:
         """Retrieve a file handle within the given translation unit."""
         return File(
             conf.lib.clang_getFile(translation_unit, os.fspath(file_name)),
         )
 
     @property
-    def name(self):
+    def name(self) -> str:
         """Return the complete file and path name of the file."""
         return _CXString.from_result(conf.lib.clang_getFileName(self))
 
     @property
-    def time(self):
+    def time(self) -> int:
         """Return the last modification time of the file."""
         return conf.lib.clang_getFileTime(self)  # type: ignore [no-any-return]
 
-    def __str__(self):
+    def __str__(self) -> str:
----------------
Endilll wrote:

Why this method has annotation for the return type while `__repr__` below 
doesn't have one?

https://github.com/llvm/llvm-project/pull/193304
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to