[llvm] [lit] Clean up internal shell parse errors with ScriptFatal (PR #68496)

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 13:43:56 PDT 2023


================
@@ -1009,7 +1020,8 @@ def formatOutput(title, data, limit=None):
     return out
 
 
-# Normally returns out, err, exitCode, timeoutInfo.
+# Always either returns the tuple (out, err, exitCode, timeoutInfo) or raises a
----------------
jdenny-ornl wrote:

> > Also, is there a way to provide names/descriptions for the tuple members?
> 
> https://docs.python.org/3/library/typing.html#typing.NamedTuple [Dataclasses](https://docs.python.org/3/library/dataclasses.html) might be relevant here as well.

If I understand that correctly, I'd be changing the return type rather than just documenting/annotating it.  Maybe the type annotation plus a comment naming the fields is enough?

> I have experience with type annotations in Python, specifically in 3.5 and 3.6 versions, so I'll be happy to review them.

Thanks for the suggestions.  I pushed a commit.  Let me know if you think something more would be worthwhile.

https://github.com/llvm/llvm-project/pull/68496


More information about the llvm-commits mailing list