Package obitools :: Package table :: Class Table
[hide private]
[frames] | no frames]

Class Table

source code


Tables are list of rows of the same model

Instance Methods [hide private]
new list
__init__(self, headers=None, types=None, colcount=None, rowFactory=None, subrowFactory=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
isCompatible(self, data) source code
 
__setitem__(self, key, value)
x[i]=y
source code
 
__getitem__(self, key)
this function has different comportements depending of the data type of key and the table used.
source code
 
__getslice__(self, x, y)
x[i:j]
source code
 
__iter__(self)
iter(x)
source code
 
__hash__(self)
hash(x)
source code
 
__add__(self, itable)
x+y
source code
 
_setTypes(self, types) source code
 
_getTypes(self) source code
 
_getHeaders(self) source code
 
_setHeaders(self, headers) source code
 
append(self, value)
append object to end
source code

Inherited from list: __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __gt__, __iadd__, __imul__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setslice__, __sizeof__, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Properties [hide private]
  types
  headers

Inherited from object: __class__

Method Details [hide private]

__init__(self, headers=None, types=None, colcount=None, rowFactory=None, subrowFactory=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • headers (list, tuple or and iterable object) - the list of column header.

    if this parametter is None, colcount parametter must be set.

  • types (list, tuple or and iterable object) - the list of data type associated to each column.

    If this parametter is specified its length must be equal to the headers length or to colcount.

  • colcount (int) - number of column in the created table.

    If headers parametter is not None this parametter is ignored

Returns: new list
Overrides: object.__init__

__setitem__(self, key, value)
(Index assignment operator)

source code 

x[i]=y

Parameters:
  • key (int, slice or str)
  • value ()
Overrides: list.__setitem__

__getitem__(self, key)
(Indexing operator)

source code 

this function has different comportements depending of the data type of key and the table used.

Parameters:
  • key (int or slice) - description of the table part to return
Returns:
return a TableRow (if key is int) or a subpart of the table (if key is slice).
Overrides: list.__getitem__

__getslice__(self, x, y)
(Slicling operator)

source code 

x[i:j]

Use of negative indices is not supported.

Overrides: list.__getslice__
(inherited documentation)

__iter__(self)

source code 

iter(x)

Overrides: list.__iter__
(inherited documentation)

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__add__(self, itable)
(Addition operator)

source code 

x+y

Overrides: list.__add__
(inherited documentation)

append(self, value)

source code 

append object to end

Overrides: list.append
(inherited documentation)

Property Details [hide private]

types

Get Method:
_getTypes(self)
Set Method:
_setTypes(self, types)

headers

Get Method:
_getHeaders(self)
Set Method:
_setHeaders(self, headers)