Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`protocols`.`amp`.`ListOf``

class documentation

`class ListOf(Argument): (source)`

Constructor: `ListOf(elementType, optional)`

View In Hierarchy

Encode and decode lists of instances of a single other argument type.

For example, if you want to pass:

        [3, 7, 9, 15]

You can create an argument like this:

        ListOf(Integer())

The serialized form of the entire list is subject to the limit imposed by `MAX_VALUE_LENGTH`. List elements are represented as 16-bit length prefixed strings. The argument type passed to the `ListOf` initializer is responsible for producing the serialized form of each element.

Parameters
optional | a boolean indicating whether this argument can be omitted in the protocol.
Present Since
10.0

Method | `__init__` | Create an Argument.
Method | `fromString` | Convert the serialized form of a list of instances of some type back into that list.
Method | `toString` | Serialize the given list of objects to a single string.
Instance Variable | `elementType` | The `Argument` instance used to encode and decode list elements (note, not an arbitrary `IArgumentType` implementation: arguments must be implemented using only the `fromString` and `toString` methods, not the ...

Inherited from `Argument`:

Method | `fromBox` | Populate an 'out' dictionary with mapping names to Python values decoded from an 'in' AmpBox mapping strings to string values.
Method | `fromStringProto` | Convert a string to a Python value.
Method | `retrieve` | Retrieve the given key from the given dictionary, removing it if found.
Method | `toBox` | Populate an 'out' AmpBox with strings encoded from an 'in' dictionary mapping names to Python values.
Method | `toStringProto` | Convert a Python object to a string.
Instance Variable | `optional` | Undocumented

def __init__(self, elementType, optional=False): (source)
overrides `twisted.protocols.amp.Argument.__init__`

Create an Argument.

Parameters
elementType | Undocumented
optional | a boolean indicating whether this argument can be omitted in the protocol.

def fromString(self, inString): (source)
overrides `twisted.protocols.amp.Argument.fromString`

Convert the serialized form of a list of instances of some type back into that list.

def toString(self, inObject): (source)
overrides `twisted.protocols.amp.Argument.toString`

Serialize the given list of objects to a single string.

elementType = (source)

The `Argument` instance used to encode and decode list elements (note, not an arbitrary `IArgumentType` implementation: arguments must be implemented using only the `fromString` and `toString` methods, not the `fromBox` and `toBox` methods).