12#ifndef PythonMonkey_JSArrayProxy_
13#define PythonMonkey_JSArrayProxy_
283static PyMappingMethods JSArrayProxy_mapping_methods = {
293static PySequenceMethods JSArrayProxy_sequence_methods = {
307 "Remove all items from list.");
313 "Return a shallow copy of the list.");
316 "append($self, object, /)\n"
319 "Append object to the end of the list.");
322 "insert($self, index, object, /)\n"
325 "Insert object before index.");
328 "extend($self, iterable, /)\n"
331 "Extend list by appending elements from the iterable.");
334 "pop($self, index=-1, /)\n"
337 "Remove and return item at index (default last).\n"
339 "Raises IndexError if list is empty or index is out of range.");
342 "remove($self, value, /)\n"
345 "Remove first occurrence of value.\n"
347 "Raises ValueError if the value is not present.");
350 "index($self, value, start=0, stop=sys.maxsize, /)\n"
353 "Return first index of value.\n"
355 "Raises ValueError if the value is not present.");
359 "count($self, value, /)\n"
362 "Return number of occurrences of value.");
365 "reverse($self, /)\n"
368 "Reverse *IN PLACE*.");
371 "sort($self, /, *, key=None, reverse=False)\n"
374 "Sort the list in ascending order and return None.\n"
376 "The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n"
377 "order of two equal elements is maintained).\n"
379 "If a key function is given, apply it once to each list item and sort them,\n"
380 "ascending or descending, according to their function values.\n"
382 "The reverse flag can be set to sort in descending order.");
385 "__reversed__($self, /)\n"
388 "Return a reverse iterator over the list.");
394static 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:190
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:1044
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:49
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:56
static PyObject * JSArrayProxy_sort(JSArrayProxy *self, PyObject *args, PyObject *kwargs)
sort method sort in place
Definition JSArrayProxy.cc:1183
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:99
static PyObject * JSArrayProxy_copy(JSArrayProxy *self)
copy method
Definition JSArrayProxy.cc:766
static PyObject * JSArrayProxy_repr(JSArrayProxy *self)
Compute a string representation of the JSArrayProxy.
Definition JSArrayProxy.cc:514
static PyObject * JSArrayProxy_remove(JSArrayProxy *self, PyObject *value)
remove method Remove first occurrence of value
Definition JSArrayProxy.cc:955
static int JSArrayProxy_contains(JSArrayProxy *self, PyObject *element)
Test contains method (.sq_contains)
Definition JSArrayProxy.cc:690
static PyObject * JSArrayProxy_inplace_repeat(JSArrayProxy *self, Py_ssize_t n)
inplace_repeat method (.sq_inplace_repeat), repeats in_place
Definition JSArrayProxy.cc:728
static PyObject * JSArrayProxy_pop(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
pop method
Definition JSArrayProxy.cc:900
static PyObject * JSArrayProxy_index(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
index method
Definition JSArrayProxy.cc:986
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:417
static PyObject * JSArrayProxy_append(JSArrayProxy *self, PyObject *value)
append method
Definition JSArrayProxy.cc:778
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:266
static void JSArrayProxy_dealloc(JSArrayProxy *self)
Deallocation method (.tp_dealloc), removes the reference to the underlying JSObject before freeing th...
Definition JSArrayProxy.cc:29
static PyObject * JSArrayProxy_iter(JSArrayProxy *self)
Return an iterator object to make JSArrayProxy iterable.
Definition JSArrayProxy.cc:582
static PyObject * JSArrayProxy_reverse(JSArrayProxy *self)
reverse method Reverse list in place
Definition JSArrayProxy.cc:1066
static PyObject * JSArrayProxy_clear_method(JSArrayProxy *self)
clear method, empties the array
Definition JSArrayProxy.cc:761
static int JSArrayProxy_clear(JSArrayProxy *self)
tp_clear
Definition JSArrayProxy.cc:43
static PyObject * JSArrayProxy_extend(JSArrayProxy *self, PyObject *iterable)
extend method
Definition JSArrayProxy.cc:837
static int JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg)
tp_traverse
Definition JSArrayProxy.cc:37
static PyObject * JSArrayProxy_repeat(JSArrayProxy *self, Py_ssize_t n)
repeat method (.sq_repeat), repeat self n number of time
Definition JSArrayProxy.cc:663
static PyObject * JSArrayProxy_inplace_concat(JSArrayProxy *self, PyObject *value)
inplace_concat method (.sq_inplace_concat), concatenates in_place
Definition JSArrayProxy.cc:708
static PyObject * JSArrayProxy_insert(JSArrayProxy *self, PyObject *const *args, Py_ssize_t nargs)
insert method
Definition JSArrayProxy.cc:788
static PyObject * JSArrayProxy_concat(JSArrayProxy *self, PyObject *value)
concat method (.sq_concat), concatenates
Definition JSArrayProxy.cc:608
static PyObject * JSArrayProxy_iter_reverse(JSArrayProxy *self)
Return a reverse iterator object to make JSArrayProxy backwards iterable.
Definition JSArrayProxy.cc:595
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