list_Python-class: Proxy Class for Python Lists

Description Methods

Description

This class is a proxy for ordinary list objects in Python. All the standard Python methods for such objects (e.g., append()) are available, but methods for R functions such as ] are not implemented because Python operators do not behave functionally. Instead, additional methods are defined for the proxy lists, e.g., el(i).

Methods

append(..., .ev = XRPython::RPython(), .get = NA)

Python Method: append() L.append(object) – append object to end

count(..., .ev = XRPython::RPython(), .get = NA)

Python Method: count() L.count(value) -> integer – return number of occurrences of value

el(i, .ev = XRPython::RPython(), .get = NA)

Extract an element from the list (zero based indexing). The index will be coerced to integer (unless a proxy).

extend(..., .ev = XRPython::RPython(), .get = NA)

Python Method: extend() L.extend(iterable) – extend list by appending elements from the iterable

index(..., .ev = XRPython::RPython(), .get = NA)

Python Method: index() L.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.

insert(..., .ev = XRPython::RPython(), .get = NA)

Python Method: insert() L.insert(index, object) – insert object before index

pop(..., .ev = XRPython::RPython(), .get = NA)

Python Method: pop() L.pop([index]) -> item – remove and return item at index (default last). Raises IndexError if list is empty or index is out of range.

remove(..., .ev = XRPython::RPython(), .get = NA)

Python Method: remove() L.remove(value) – remove first occurrence of value. Raises ValueError if the value is not present.

reverse(..., .ev = XRPython::RPython(), .get = NA)

Python Method: reverse() L.reverse() – reverse *IN PLACE*

sort(..., .ev = XRPython::RPython(), .get = NA)

Python Method: sort() L.sort(cmp=None, key=None, reverse=False) – stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1


XRPython documentation built on May 2, 2019, 9:33 a.m.