Home
Overview
Fundamentals
Glossary
Cheatsheet
API Reference
Quick Recipes
Deep Dive
Common Pitfalls and Gotchas
Persistent Storage
Operators to create tuples.
kd.tuples.get_namedtuple_field(namedtuple: NamedTuple, field_name: str | DataItem) -> AnyReturns the value of the specified `field_name` from the `namedtuple`.
Args:
namedtuple: a namedtuple.
field_name: the name of the field to return.
kd.tuples.get_nth(x: Any, n: SupportsIndex) -> AnyReturns the nth element of the tuple `x`.
Args:
x: a tuple.
n: the index of the element to return. Must be in the range [0, len(x)).
kd.tuples.namedtuple(**kwargs)Aliases:
Returns a namedtuple-like object containing the given `**kwargs`.
kd.tuples.slice(start=unspecified, stop=unspecified, step=unspecified)Returns a slice for the Python indexing syntax foo[start:stop:step].
Args:
start: (optional) Indexing start.
stop: (optional) Indexing stop.
step: (optional) Indexing step size.
kd.tuples.tuple(*args)Aliases:
Returns a tuple-like object containing the given `*args`.