File: py_len.Rd

package info (click to toggle)
r-cran-reticulate 1.41.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,088 kB
  • sloc: cpp: 5,154; python: 620; sh: 13; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 949 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/python.R
\name{py_len}
\alias{py_len}
\title{Length of Python object}
\usage{
py_len(x, default = NULL)
}
\arguments{
\item{x}{A Python object.}

\item{default}{The default length value to return, in the case that
the associated Python object has no \verb{__len__} method. When \code{NULL}
(the default), an error is emitted instead.}
}
\value{
The length of the object, as a numeric value.
}
\description{
Get the length of a Python object. This is equivalent to calling
the Python builtin \code{len()} function on the object.
}
\details{
Not all Python objects have a defined length. For objects without a defined
length, calling \code{py_len()} will throw an error. If you'd like to instead
infer a default length in such cases, you can set the \code{default} argument
to e.g. \code{1L}, to treat Python objects without a \verb{__len__} method as having
length one.
}