Path

Enhancement on tuple logical operations to ease the search on tuple of keys.

API

class vector_dict.VectorDict.Path(a_tuple)
contains(*a_tuple)

checks if the serie of keys is contained in a path

>>> p = Path( [ 'a', 'b', 'c', 'd' ] )
>>> p.contains( 'b', 'c' )
>>> True
endswith(*a_tuple)

check if path ends with the consecutive given has argumenbts value

>>> p = Path( [ 'a', 'b', 'c' ] )
>>> p.endswith( 'b', 'c' )
>>> True
>>> p.endswith( 'c', 'b' )
>>> False
startswith(*a_tuple)

checks if a path starts with the value

>>> p = Path( [ 'a', 'b', 'c', 'd' ] )
>>> p.startswith( 'a', 'b' )
>>> True

Table Of Contents

Previous topic

Clause and operations

Next topic

ConsistentAlgebrae: testing algebrae consistency

This Page