Pins#
The wireable fields of a component or object as a mapping (component.pins, obj.pins): values by name, and typed Pin handles.
Obtain with component.pins or obj.pins. Existing component.props.pin(key) calls remain supported.
| Expression | Result |
|---|---|
pins[key] | Authored field value |
pins[key] = value | Write authored value |
pins.pin(key) | Typed Pin handle |
pins.schema() | Tuple of descriptors: names, labels, kinds and pin handles |
for key in pins, len(pins) | Available names and count |
Missing names raise KeyError; ambiguous object-wide names raise AmbiguousError. Choose a specific component to resolve ambiguity. Registered keys and native script-field labels are exact.
class Pins(Mapping)A read-only mapping protocol (x[key], for key in x, len(x), key in x, .get, .keys(), .items()); writes are listed below when supported.
Usage and examples
Members: schema · Iteration · Length · pin · Indexing · Assignment
schema#
schema()Descriptors: names, labels, kinds and the pin handles.
Iteration#
for item in xThe available pin names.
Length#
len(x)How many pins there are.
pin#
pin(key)The typed Pin for a name: KeyError when missing, AmbiguousError when several components have it (use that component's pins).
Indexing#
x[key]The authored value of a pin.
Assignment#
x[key] = valueWrite the authored value of a pin.
Related types#
Source#
- _live.py:1819