File: PyClass.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 (37 lines) | stat: -rw-r--r-- 763 bytes parent folder | download | duplicates (3)
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
30
31
32
33
34
35
36
37
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/class.R
\name{PyClass}
\alias{PyClass}
\title{Create a python class}
\usage{
PyClass(classname, defs = list(), inherit = NULL)
}
\arguments{
\item{classname}{Name of the class. The class name is useful for S3 method
dispatch.}

\item{defs}{A named list of class definitions - functions, attributes, etc.}

\item{inherit}{A list of Python class objects. Usually these objects have
the \code{python.builtin.type} S3 class.}
}
\description{
Create a python class
}
\examples{
\dontrun{
Hi <- PyClass("Hi", list(
  name = NULL,
  `__init__` = function(self, name) {
    self$name <- name
    NULL
  },
  say_hi = function(self) {
    paste0("Hi ", self$name)
  }
))

a <- Hi("World")
}

}