Previous topic

collada.util

Next topic

collada.util.checkSource

This Page

collada.util.IndexedList

class collada.util.IndexedList(items, attrs)

Bases: list

Class that combines a list and a dict into a single class
Given an object, obj, that has a property x, this allows you to create an IndexedList like so:
L = IndexedList([], (‘x’)) o = obj() o.x = ‘test’ L.append(o) L[0] # = o L[‘test’] # = o
__init__(items, attrs)

Methods

__init__(items, attrs)
append(obj)
extend(newList)
get(key[, default])
insert(ind, new_obj)
pop([ind])
remove(ind_or_obj)

Attributes

count(...)
index((value, [start, ...) Raises ValueError if the value is not present.
reverse L.reverse() – reverse IN PLACE
sort L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE;
count(value) → integer -- return number of occurrences of value
index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

reverse()

L.reverse() – reverse IN PLACE

sort()

L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; cmp(x, y) -> -1, 0, 1