PyList class

Inheritance
Available extensions

Constructors

PyList(int size)
factory
PyList.fromBorrowedHandle(Pointer<PyObject> ptr)
Acquires an owned reference from a borrowed native pointer.
factory
PyList.fromHandle(Pointer<PyObject> ptr)
Takes ownership of one new native reference.
factory
PyList.fromRef(PyRef ref)

Properties

hashCode → int
The hash code for this object.
no setterinherited
isDisposed → bool
Whether the shared owned reference has been disposed.
no setterinherited
length → int
no setter
ptr → Pointer<PyObject>
no setterinherited
ref → PyRef
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(PyObject item) → void
ref++
asBool() → bool

Available on PyObject, provided by the PyObjectConverter extension

asDouble() → double

Available on PyObject, provided by the PyObjectConverter extension

asInt() → int

Available on PyObject, provided by the PyObjectConverter extension

asString() → String

Available on PyObject, provided by the PyObjectConverter extension

call(PyTuple args, [PyDict? kwargs]) → PyObject

Available on PyObject, provided by the PyObjectCall extension

call0() → PyObject

Available on PyObject, provided by the PyObjectCall extension

callN(List<PyObject> args) → PyObject

Available on PyObject, provided by the PyObjectCall extension

Calls with arguments whose ownership remains with the caller.
compare(PyObject other, PyComparison comparison) → bool

Available on PyObject, provided by the PyObjectOperator extension

python: bool(a < b), bool(a <= b), bool(a == b), bool(a != b), bool(a > b), bool(a >= b) (by comparison)
deleteItem(PyObject key) → void

Available on PyObject, provided by the PyObjectAttributes extension

detachFromScope() → PyObject
Removes this resource from its current automatic ResourceScope so it survives beyond the scope's lifetime.
inherited
detachToParentScope() → PyObject
Detaches this resource from the current inner ResourceScope and promotes it to the parent outer scope (if one exists).
inherited
dispose() → void
Explicitly releases native memory or resources immediately.
inherited
elementAt(int index) → PyObject
Returns an independent owned reference.
equals(PyObject other) → bool

Available on PyObject, provided by the PyObjectOperator extension

python: a == b
forward(List<Object?> args, {Map<String, Object?>? kwargs, PyConverter? converter}) → PyObject

Available on PyObject, provided by the PyObjectForward extension

Calls this Python callable with Dart positional and keyword arguments.
getAttr(String attribute) → PyObject

Available on PyObject, provided by the PyObjectAttributes extension

Get the attribute of a Python object.
getAttrBool(String attribute) → bool

Available on PyObject, provided by the PyObjectAttributes extension

getAttrDouble(String attribute) → double

Available on PyObject, provided by the PyObjectAttributes extension

getAttrInt(String attribute) → int

Available on PyObject, provided by the PyObjectAttributes extension

getAttrObject(PyObject attribute) → PyObject

Available on PyObject, provided by the PyObjectAttributes extension

getAttrString(String attribute) → String

Available on PyObject, provided by the PyObjectAttributes extension

getItem(PyObject key) → PyObject

Available on PyObject, provided by the PyObjectAttributes extension

Get the item of a Python object using the subscript operator.
hasAttr(String attribute) → bool

Available on PyObject, provided by the PyObjectAttributes extension

hasAttrObject(PyObject attribute) → bool

Available on PyObject, provided by the PyObjectAttributes extension

inPlaceAdd(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a += b
inPlaceAnd(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a &= b
inPlaceFloorDivide(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a //= b
inPlaceLshift(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a <<= b
inPlaceMatrixMultiply(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a @= b
inPlaceMultiply(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a *= b
inPlaceOr(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a |= b
inPlacePower(PyObject exponent, [PyObject? modulus]) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a **= b; with modulus: a = pow(a, b, modulus) Python power, optionally with a modulus. An omitted modulus uses None.
inPlaceRemainder(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a %= b
inPlaceRshift(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a >>= b
inPlaceSubtract(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a -= b
inPlaceTrueDivide(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a /= b
inPlaceXor(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a ^= b
insert(int index, PyObject item) → void
ref++
matrixMultiply(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a @ b
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notEquals(PyObject other) → bool

Available on PyObject, provided by the PyObjectOperator extension

python: a != b
positive() → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: +a
retain() → PyObject
Acquires a separately scoped reference to this Python object.
inherited
reverse() → void
richCompare(PyObject other, PyComparison comparison) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a < b, a <= b, a == b, a != b, a > b, a >= b (by comparison) Preserves custom comparison results, such as array masks.
setAttr(String attribute, PyObject value) → void

Available on PyObject, provided by the PyObjectAttributes extension

Set the attribute of a Python object to a new value.
setAttrObject(PyObject attribute, PyObject value) → void

Available on PyObject, provided by the PyObjectAttributes extension

setElementAt(int index, PyObject item) → void
Retains item; the caller keeps its existing reference.
setItem(PyObject key, PyObject value) → void

Available on PyObject, provided by the PyObjectAttributes extension

sort() → void
toString() → String
A string representation of this object.
inherited
withContext<T>(T action(PyObject)) → T

Available on PyObject, provided by the PyObjectWithContext extension

Runs a synchronous Python context manager in a temporary resource scope.

Operators

operator %(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a % b
operator &(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a & b
operator *(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a * b
operator +(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a + b
operator -(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a - b
operator /(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a / b
operator <(PyObject other) → bool

Available on PyObject, provided by the PyObjectOperator extension

python: a < b
operator <<(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a << b
operator <=(PyObject other) → bool

Available on PyObject, provided by the PyObjectOperator extension

python: a <= b
operator ==(Object other) → bool
The equality operator.
inherited
operator >(PyObject other) → bool

Available on PyObject, provided by the PyObjectOperator extension

python: a > b
operator >=(PyObject other) → bool

Available on PyObject, provided by the PyObjectOperator extension

python: a >= b
operator >>(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a >> b
operator [](int index) → PyObject
operator []=(int index, PyObject item) → void
operator ^(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a ^ b
operator unary-() → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: -a
operator |(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a | b
operator ~() → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: ~a
operator ~/(PyObject other) → PyObject

Available on PyObject, provided by the PyObjectOperator extension

python: a // b