OpenQuizz
Une application de gestion des contenus pédagogiques
IterableList Class Reference
Inheritance diagram for IterableList:
Collaboration diagram for IterableList:

Public Member Functions

def __new__ (cls, id_attr, prefix='')
 
def __init__ (self, id_attr, prefix='')
 
def __contains__ (self, attr)
 
def __getattr__ (self, attr)
 
def __getitem__ (self, index)
 
def __delitem__ (self, index)
 

Detailed Description

List of iterable objects allowing to query an object by id or by named index::

 heads = repo.heads
 heads.master
 heads['master']
 heads[0]

It requires an id_attribute name to be set which will be queried from its
contained items to have a means for comparison.

A prefix can be specified which is to be used in case the id returned by the
items always contains a prefix that does not matter to the user, so it
can be left out.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  id_attr,
  prefix = '' 
)

Member Function Documentation

◆ __contains__()

def __contains__ (   self,
  attr 
)

◆ __delitem__()

def __delitem__ (   self,
  index 
)

◆ __getattr__()

def __getattr__ (   self,
  attr 
)

◆ __getitem__()

def __getitem__ (   self,
  index 
)

◆ __new__()

def __new__ (   cls,
  id_attr,
  prefix = '' 
)

The documentation for this class was generated from the following file: