PythonMonkey   v1.0.1 (dev)
Loading...
Searching...
No Matches
JSArrayProxy.hh File Reference

JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would. More...

#include <jsapi.h>
#include <Python.h>
Include dependency graph for JSArrayProxy.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  JSArrayProxy
 The typedef for the backing store that will be used by JSArrayProxy objects. All it contains is a pointer to the JSObject. More...
 
struct  JSArrayProxyMethodDefinitions
 This struct is a bundle of methods used by the JSArrayProxy type. More...
 

Functions

 PyDoc_STRVAR (py_list_clear__doc__, "clear($self, /)\n" "--\n" "\n" "Remove all items from list.")
 
 PyDoc_STRVAR (list_copy__doc__, "copy($self, /)\n" "--\n" "\n" "Return a shallow copy of the list.")
 
 PyDoc_STRVAR (list_append__doc__, "append($self, object, /)\n" "--\n" "\n" "Append object to the end of the list.")
 
 PyDoc_STRVAR (list_insert__doc__, "insert($self, index, object, /)\n" "--\n" "\n" "Insert object before index.")
 
 PyDoc_STRVAR (py_list_extend__doc__, "extend($self, iterable, /)\n" "--\n" "\n" "Extend list by appending elements from the iterable.")
 
 PyDoc_STRVAR (list_pop__doc__, "pop($self, index=-1, /)\n" "--\n" "\n" "Remove and return item at index (default last).\n" "\n" "Raises IndexError if list is empty or index is out of range.")
 
 PyDoc_STRVAR (list_remove__doc__, "remove($self, value, /)\n" "--\n" "\n" "Remove first occurrence of value.\n" "\n" "Raises ValueError if the value is not present.")
 
 PyDoc_STRVAR (list_index__doc__, "index($self, value, start=0, stop=sys.maxsize, /)\n" "--\n" "\n" "Return first index of value.\n" "\n" "Raises ValueError if the value is not present.")
 
 PyDoc_STRVAR (list_count__doc__, "count($self, value, /)\n" "--\n" "\n" "Return number of occurrences of value.")
 
 PyDoc_STRVAR (list_reverse__doc__, "reverse($self, /)\n" "--\n" "\n" "Reverse *IN PLACE*.")
 
 PyDoc_STRVAR (list_sort__doc__, "sort($self, /, *, key=None, reverse=False)\n" "--\n" "\n" "Sort the list in ascending order and return None.\n" "\n" "The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n" "order of two equal elements is maintained).\n" "\n" "If a key function is given, apply it once to each list item and sort them,\n" "ascending or descending, according to their function values.\n" "\n" "The reverse flag can be set to sort in descending order.")
 
 PyDoc_STRVAR (list___reversed____doc__, "__reversed__($self, /)\n" "--\n" "\n" "Return a reverse iterator over the list.")
 

Variables

PyTypeObject JSArrayProxyType
 Struct for the JSArrayProxyType, used by all JSArrayProxy objects.
 

Detailed Description

JSArrayProxy is a custom C-implemented python type that derives from list. It acts as a proxy for JSArrays from Spidermonkey, and behaves like a list would.

Author
Philippe Laporte (phili.nosp@m.ppe@.nosp@m.distr.nosp@m.ibut.nosp@m.ive.n.nosp@m.etwo.nosp@m.rk)
Version
0.1
Date
2023-11-22

Function Documentation

◆ PyDoc_STRVAR() [1/12]

PyDoc_STRVAR ( list___reversed____doc__  ,
"__reversed__($self, /)\n" "--\n" "\n" "Return a reverse iterator over the list."   
)

◆ PyDoc_STRVAR() [2/12]

PyDoc_STRVAR ( list_append__doc__  ,
"append($self, object, /)\n" "--\n" "\n" "Append object to the end of the list."   
)

◆ PyDoc_STRVAR() [3/12]

PyDoc_STRVAR ( list_copy__doc__  ,
"copy($self, /)\n" "--\n" "\n" "Return a shallow copy of the list."   
)

◆ PyDoc_STRVAR() [4/12]

PyDoc_STRVAR ( list_count__doc__  ,
"count($self, value, /)\n" "--\n" "\n" "Return number of occurrences of value."   
)

◆ PyDoc_STRVAR() [5/12]

PyDoc_STRVAR ( list_index__doc__  ,
"index($self, value, start=0, stop=sys.maxsize, /)\n" "--\n" "\n" "Return first index of value.\n" "\n" "Raises ValueError if the value is not present."   
)

◆ PyDoc_STRVAR() [6/12]

PyDoc_STRVAR ( list_insert__doc__  ,
"insert($self, index, object, /)\n" "--\n" "\n" "Insert object before index."   
)

◆ PyDoc_STRVAR() [7/12]

PyDoc_STRVAR ( list_pop__doc__  ,
"pop($self, index=-1, /)\n" "--\n" "\n" "Remove and return item at index (default last).\n" "\n" "Raises IndexError if list is empty or index is out of range."   
)

◆ PyDoc_STRVAR() [8/12]

PyDoc_STRVAR ( list_remove__doc__  ,
"remove($self, value, /)\n" "--\n" "\n" "Remove first occurrence of value.\n" "\n" "Raises ValueError if the value is not present."   
)

◆ PyDoc_STRVAR() [9/12]

PyDoc_STRVAR ( list_reverse__doc__  ,
"reverse($self, /)\n" "--\n" "\n" "Reverse *IN PLACE*."   
)

◆ PyDoc_STRVAR() [10/12]

PyDoc_STRVAR ( list_sort__doc__  ,
"sort($self, /, *, key=None, reverse=False)\n" "--\n" "\n" "Sort the list in ascending order and return None.\n" "\n" "The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n" "order of two equal elements is maintained).\n" "\n" "If a key function is  given,
apply it once to each list item and sort  them,
\n" "ascending or  descending,
according to their function values.\n" "\n" "The reverse flag can be set to sort in descending order."   
)

◆ PyDoc_STRVAR() [11/12]

PyDoc_STRVAR ( py_list_clear__doc__  ,
"clear($self, /)\n" "--\n" "\n" "Remove all items from list."   
)

◆ PyDoc_STRVAR() [12/12]

PyDoc_STRVAR ( py_list_extend__doc__  ,
"extend($self, iterable, /)\n" "--\n" "\n" "Extend list by appending elements from the iterable."   
)

Variable Documentation

◆ JSArrayProxyType

PyTypeObject JSArrayProxyType
extern

Struct for the JSArrayProxyType, used by all JSArrayProxy objects.