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 7443b8eab7 Correct Python cardinality functions and add format_() to
steps list
7443b8eab7 is described below
commit 7443b8eab7c9e3ec14e0a46d8ced05f727460655
Author: Stephen Mallette <[email protected]>
AuthorDate: Wed Sep 9 20:39:03 2026 +0000
Correct Python cardinality functions and add format_() to steps list
The Gremlin-Python Differences section listed the value-taking
cardinality functions as list(), set() and single(), but CardinalityValue
actually exposes single(), list_() and set_(). Calling
CardinalityValue.list()
or CardinalityValue.set() raises AttributeError, so the documented spelling
does not work. Correct the sentence and note that list and set are renamed
with a trailing underscore because they overlap with Python built-ins.
Also add the missing format_() step to the list of underscore-suffixed
steps.
Assisted-by: Kiro:claude-opus-4.8
---
docs/src/reference/gremlin-variants.asciidoc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/src/reference/gremlin-variants.asciidoc
b/docs/src/reference/gremlin-variants.asciidoc
index 4f435c35b3..f6352aa1ad 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -3907,7 +3907,7 @@ that makes traversals a bit more concise.
In situations where Python reserved words and global functions overlap with
standard Gremlin steps and tokens, those
bits of conflicting Gremlin get an underscore appended as a suffix:
-*Steps* - <<all-step,all_()>>, <<and-step,and_()>>, <<any-step,any_()>>,
<<as-step,as_()>>, <<filter-step,filter_()>>, <<from-step,from_()>>,
+*Steps* - <<all-step,all_()>>, <<and-step,and_()>>, <<any-step,any_()>>,
<<as-step,as_()>>, <<filter-step,filter_()>>, <<format-step,format_()>>,
<<from-step,from_()>>,
<<id-step,id_()>>, <<is-step,is_()>>, <<in-step,in_()>>, <<max-step,max_()>>,
<<min-step,min_()>>, <<not-step,not_()>>, <<or-step,or_()>>,
<<range-step,range_()>>, <<sum-step,sum_()>>,
<<with-step,with_()>>
@@ -3915,8 +3915,9 @@ bits of conflicting Gremlin get an underscore appended as
a suffix:
*Tokens* - <<a-note-on-scopes,Scope.global_>>, `Direction.from_`,
`Operator.sum_`
In addition, the enum construct for `Cardinality` cannot have functions
attached to it the way it can be done in Java,
-therefore cardinality functions that take a value like `list()`, `set()`, and
`single()` are referenced from a
-`CardinalityValue` class rather than `Cardinality` itself.
+therefore cardinality functions that take a value like `single()`, `list_()`,
and `set_()` are referenced from a
+`CardinalityValue` class rather than `Cardinality` itself. Note that `list`
and `set` overlap with Python built-ins and
+so are spelled with a trailing underscore, while `single()` is unchanged.
[[gremlin-python-limitations]]
=== Limitations