File: py_bool.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 (24 lines) | stat: -rw-r--r-- 742 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/python.R
\name{py_bool}
\alias{py_bool}
\title{Python Truthiness}
\usage{
py_bool(x)
}
\arguments{
\item{x, }{A python object.}
}
\value{
An R scalar logical: \code{TRUE} or \code{FALSE}. If \code{x} is a
null pointer or Python is not initialized, \code{FALSE} is returned.
}
\description{
Equivalent to \code{bool(x)} in Python, or \verb{not not x}.
}
\details{
If the Python object defines a \verb{__bool__} method, then that is invoked.
Otherwise, if the object defines a \verb{__len__} method, then \code{TRUE} is
returned if the length is nonzero. If neither \verb{__len__} nor \verb{__bool__}
are defined, then the Python object is considered \code{TRUE}.
}