Package ndg :: Package saml :: Package utils :: Class TypedList
[hide private]

Class TypedList

source code


Extend list type to enabled only items of a given type. Supports any type where the array type in the Standard Library is restricted to only limited set of primitive types

Instance Methods [hide private]
new empty list
__init__(self, elementType, *arg, **kw)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
type
_getElementType(self)
Returns: element type for this list
source code
 
extend(self, iter)
Extend an existing list with the input iterable
source code
 
__iadd__(self, iter)
Extend an existing list with the input iterable with += operator
source code
 
append(self, item)
Append a list with the given item
source code

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

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

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]
  elementType
The allowed type or types for list elements

Inherited from object: __class__

Method Details [hide private]

__init__(self, elementType, *arg, **kw)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • elementType (type/tuple) - object type or types which the list is allowed to contain. If more than one type, pass as a tuple
Returns: new empty list
Overrides: object.__init__

_getElementType(self)

source code 
Returns: type
element type for this list

extend(self, iter)

source code 

Extend an existing list with the input iterable

Parameters:
  • iter (iterable) - iterable to extend list with
Overrides: list.extend

__iadd__(self, iter)

source code 

Extend an existing list with the input iterable with += operator

Parameters:
  • iter (iterable) - iterable to extend list with
Overrides: list.__iadd__

append(self, item)

source code 

Append a list with the given item

Parameters:
  • item (must agree witj "elementType" attribute of this list) - item to extend list
Overrides: list.append

Property Details [hide private]

elementType

The allowed type or types for list elements

Get Method:
_getElementType(self) - Returns: element type for this list