This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 2958fa0af2 Clarify that difference() and intersect() return a Set
2958fa0af2 is described below
commit 2958fa0af254353a7d413108c4f0a4023b01355a
Author: stepmall <[email protected]>
AuthorDate: Fri Jul 24 19:11:18 2026 +0000
Clarify that difference() and intersect() return a Set
The reference documentation for the difference()- and intersect()-steps
described their result as a list, but both steps return a Set: element
order is not preserved and duplicate elements are removed. Both sections
now state this while keeping the existing description of the A-B and
intersection semantics, the array/Iterable input expectation, and the
IllegalArgumentException thrown for other input types (including null).
Assisted-by: Kiro:claude-opus-4.8
---
docs/src/reference/the-traversal.asciidoc | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/docs/src/reference/the-traversal.asciidoc
b/docs/src/reference/the-traversal.asciidoc
index 36e66f67ca..cda8568bf5 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -1790,8 +1790,9 @@
link:++https://tinkerpop.apache.org/docs/x.y.z/dev/provider/#dedup-step++[`Seman
=== Difference Step
The `difference()`-step (*map*) calculates the difference between the incoming
list traverser and the provided list
-argument. More specifically, this provides the set operation A-B where A is
the traverser and B is the argument. This
-step only expects list data (array or Iterable) and will throw an
`IllegalArgumentException` if any other type is
+argument. More specifically, this provides the set operation A-B where A is
the traverser and B is the argument. The
+result is returned as a `Set`, so element order is not preserved and
duplicates are removed. This step only expects
+list data (array or Iterable) as input and will throw an
`IllegalArgumentException` if any other type is
encountered (including `null`).
[gremlin-groovy,modern]
@@ -2528,7 +2529,8 @@
link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gre
=== Intersect Step
The `intersect()`-step (*map*) calculates the intersection between the
incoming list traverser and the provided list
-argument. This step only expects list data (array or Iterable) and will throw
an `IllegalArgumentException` if any other
+argument. The result is returned as a `Set`, so element order is not preserved
and duplicates are removed. This step
+only expects list data (array or Iterable) as input and will throw an
`IllegalArgumentException` if any other
type is encountered (including `null`).
[gremlin-groovy,modern]