Package cssutils :: Module util :: Class Seq |
[hide private]
[frames] | no frames]

# Class Seq

source code

    object --+
             |
            Seq

(EXPERIMENTAL) a list like sequence of (value, type) used in some cssutils classes as property `seq`

behaves almost like a list but keeps extra attribute "type" for each value in the list

types are token types like e.g. "COMMENT" (all uppercase, value='/.../') or productions like e.g. "universal" (all lowercase, value='*')

Instance Methods | [hide private]
__init__(self) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code
__contains__(self, item) | source code
__delitem__(self, index) | source code
__getitem__(self, index) | source code
__setitem__(self, index, value_type) might be set with tuple (value, type) or a single value | source code
__iter__(self) returns an iterator for values | source code
__len__(self) same as len(list) | source code
__repr__(self) returns a repr same as a list of tuples of (value, type) | source code
__str__(self) returns a concatated string of all values | source code
append(self, value, type=None) same as list.append but not a simple value but a SeqItem is appended | source code
_get_values_types(self) | source code
Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Properties | [hide private]
| _items EXPERIMENTAL: returns an iterator for (value, type) tuples
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self) (Constructor) | source code
x.__init__(...) initializes x; see x.__class__.__doc__ for signature Overrides: object.__init__ (inherited documentation)

### __repr__(self) (Representation operator) | source code
returns a repr same as a list of tuples of (value, type) Overrides: object.__repr__

### __str__(self) (Informal representation operator) | source code
returns a concatated string of all values Overrides: object.__str__

Property Details | [hide private]

  ### _items EXPERIMENTAL: returns an iterator for (value, type) tuples Get Method: cssutils.util.Seq._get_values_types(self) Set Method:
      None
  Delete Method:
      None