This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git
The following commit(s) were added to refs/heads/main by this push:
new ce3fe0f Explain a method naming convention
ce3fe0f is described below
commit ce3fe0f47f531e3df3399faf28b560390aebd204
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Jul 22 15:49:53 2025 +0100
Explain a method naming convention
---
atr/storage/types.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/atr/storage/types.py b/atr/storage/types.py
index c4a7be3..9752c84 100644
--- a/atr/storage/types.py
+++ b/atr/storage/types.py
@@ -165,6 +165,12 @@ class Outcomes[T, E: Exception = Exception]:
self.append_result(result)
def extend_roes(self, exception_type: type[E], roes: Sequence[T | E]) ->
None:
+ # The name "roe" is short for "result or exception"
+ # It looks opaque and jargonistic, but it has an advantage when
forming plurals
+ # The long form plural is "result or exceptions", which is ambiguous
+ # I.e. we mean Seq[Result | Exception], but it also looks like Result
| Seq[Exception]
+ # The short form, however, encapsulates it so that ROE = Result |
Exception
+ # Then clearly the short form plural, "roes", means Seq[ROE]
for roe in roes:
self.append_roe(exception_type, roe)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]