3.2.2.23. sphinx.ext.autodoc.ViewList

class sphinx.ext.autodoc.ViewList(initlist=None, source=None, items=None, parent=None, parent_offset=None)[source]

List with extended functionality: slices of ViewList objects are child lists, linked to their parents. Changes made to a child list also affect the parent list. A child list is effectively a “view” (in the SQL sense) of the parent list. Changes to parent lists, however, do not affect active child lists. If a parent list is changed, any active child lists should be recreated.

The start and end of the slice can be trimmed using the trim_start() and trim_end() methods, without affecting the parent list. The link between child and parent lists can be broken by calling disconnect() on the child list.

Also, ViewList objects keep track of the source & offset of each item. This information is accessible via the source(), offset(), and info() methods.

3.2.2.23.1. Methods

__init__([initlist, source, items, parent, ...])
append(item[, source, offset])
count(item)
disconnect() Break link between this list and parent list.
extend(other)
index(item)
info(i) Return source & offset for index i.
insert(i, item[, source, offset])
offset(i) Return offset for index i.
pop([i])
pprint() Print the list in grep format (source:offset:value lines)
remove(item)
reverse()
sort(*args)
source(i) Return source for index i.
trim_end([n]) Remove items from the end of the list, without touching the parent.
trim_start([n]) Remove items from the start of the list, without touching the parent.
xitems() Return iterator yielding (source, offset, value) tuples.