12#ifndef PythonMonkey_JSArrayProxy_
13#define PythonMonkey_JSArrayProxy_
284static PyMappingMethods JSArrayProxy_mapping_methods = {
294static PySequenceMethods JSArrayProxy_sequence_methods = {
308 "Remove all items from list.");
314 "Return a shallow copy of the list.");
317 "append($self, object, /)\n"
320 "Append object to the end of the list.");
323 "insert($self, index, object, /)\n"
326 "Insert object before index.");
329 "extend($self, iterable, /)\n"
332 "Extend list by appending elements from the iterable.");
335 "pop($self, index=-1, /)\n"
338 "Remove and return item at index (default last).\n"
340 "Raises IndexError if list is empty or index is out of range.");
343 "remove($self, value, /)\n"
346 "Remove first occurrence of value.\n"
348 "Raises ValueError if the value is not present.");
351 "index($self, value, start=0, stop=sys.maxsize, /)\n"
354 "Return first index of value.\n"
356 "Raises ValueError if the value is not present.");
360 "count($self, value, /)\n"
363 "Return number of occurrences of value.");
366 "reverse($self, /)\n"
369 "Reverse *IN PLACE*.");
372 "sort($self, /, *, key=None, reverse=False)\n"
375 "Sort the list in ascending order and return None.\n"
377 "The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n"
378 "order of two equal elements is maintained).\n"
380 "If a key function is given, apply it once to each list item and sort them,\n"
381 "ascending or descending, according to their function values.\n"
383 "The reverse flag can be set to sort in descending order.");
386 "__reversed__($self, /)\n"
389 "Return a reverse iterator over the list.");
395static PyMethodDef JSArrayProxy_methods[] = {
PyDoc_STRVAR(py_list_clear__doc__, "clear($self, /)\n" "--\n" "\n" "Remove all items from list.")
PyTypeObject JSArrayProxyType
Struct for the JSArrayProxyType, used by all JSArrayProxy objects.
Definition pythonmonkey.cc:189
This struct is a bundle of methods used by the JSArrayProxy type.
Definition JSArrayProxy.hh:34
static PyObject * JSArrayProxy_count(JSArrayProxy *self, PyObject *value)
count method
Definition JSArrayProxy.cc:1043
static Py_ssize_t JSArrayProxy_length(JSArrayProxy *self)
Length method (.mp_length and .sq_length), returns the number of keys in the JSObject,...
Definition JSArrayProxy.cc:48
static PyObject * JSArrayProxy_get(JSArrayProxy *self, PyObject *key)
returns a value from the JSArrayProxy given a key, or dispatches to the given key method if such meth...
Definition JSArrayProxy.cc:55
static PyObject * JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key)
Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice...
Definition JSArrayProxy.cc:98
static PyObject * JSArrayProxy_copy(JSArrayProxy *self)
copy method
Definition JSArrayProxy.cc:765
static PyObject * JSArrayProxy_repr(JSArrayProxy *self)
Compute a string representation of the JSArrayProxy.
Definition JSArrayProxy.cc:513
static PyObject * JSArrayProxy_remove(JSArrayProxy *self, PyObject *value)
remove method Remove first occurrence of value
Definition JSArrayProxy.cc:954
static int JSArrayProxy_contains(JSArrayProxy *self, PyObject *element)
Test contains method (.sq_contains)
Definition JSArrayProxy.cc:689
static PyObject * JSArrayProxy_sort(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
sort method sort in place
Definition JSArrayProxy.cc:1182
static PyObject * JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n)
inplace_repeat method (.sq_inplace_repeat), repeats in_place
Definition JSArrayProxy.cc:727
static PyObject * JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
pop method
Definition JSArrayProxy.cc:899
static PyObject * JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
index method
Definition JSArrayProxy.cc:985
static PyObject * JSArrayProxy_richcompare(JSArrayProxy *self, PyObject *other, int op)
Comparison method (.tp_richcompare), returns appropriate boolean given a comparison operator and othe...
Definition JSArrayProxy.cc:416
static PyObject * JSArrayProxy_append(JSArrayProxy *self, PyObject *value)
append method
Definition JSArrayProxy.cc:777
static int JSArrayProxy_assign_key(JSArrayProxy *self, PyObject *key, PyObject *value)
Assign method (.mp_ass_subscript), assigns a key-value pair if value is non-NULL, or deletes a key-va...
Definition JSArrayProxy.cc:265
static void JSArrayProxy_dealloc(JSArrayProxy *self)
Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing th...
Definition JSArrayProxy.cc:28
static PyObject * JSArrayProxy_iter(JSArrayProxy *self)
Return an iterator object to make JSArrayProxy iterable.
Definition JSArrayProxy.cc:581
static PyObject * JSArrayProxy_reverse(JSArrayProxy *self)
reverse method Reverse list in place
Definition JSArrayProxy.cc:1065
static PyObject * JSArrayProxy_clear_method(JSArrayProxy *self)
clear method, empties the array
Definition JSArrayProxy.cc:760
static int JSArrayProxy_clear(JSArrayProxy *self)
tp_clear
Definition JSArrayProxy.cc:42
static PyObject * JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable)
extend method
Definition JSArrayProxy.cc:836
static int JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg)
tp_traverse
Definition JSArrayProxy.cc:36
static PyObject * JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n)
repeat method (.sq_repeat), repeat self n number of time
Definition JSArrayProxy.cc:662
static PyObject * JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value)
inplace_concat method (.sq_inplace_concat), concatenates in_place
Definition JSArrayProxy.cc:707
static PyObject * JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
insert method
Definition JSArrayProxy.cc:787
static PyObject * JSArrayProxy_concat(JSArrayProxy *self, PyObject *value)
concat method (.sq_concat), concatenates
Definition JSArrayProxy.cc:607
static PyObject * JSArrayProxy_iter_reverse(JSArrayProxy *self)
Return a reverse iterator object to make JSArrayProxy backwards iterable.
Definition JSArrayProxy.cc:594
The typedef for the backing store that will be used by JSArrayProxy objects. All it contains is a poi...
Definition JSArrayProxy.hh:25
JS::PersistentRootedObject * jsArray
Definition JSArrayProxy.hh:27
PyListObject list
Definition JSArrayProxy.hh:26