Skip to content

WKPlus/rangedict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#rangedict Build Status Coverage Status

rangedict is a dict whose key can be a range.

##Usage

    >>> from rangedict import RangeDict
    >>> rd = RangeDict()
    >>> rd[(1, 2)] = 1
    >>> rd[(3, 3)] = 3
    >>> rd[(5, 7)] = 5
    >>> print rd[6]
    5
    >>> 3 in rd
    True
    >>> del rd[(3, 3)]
    >>> 3 in rd
    False

Implemented based on red black tree provides an O(logn) complexity for inserting, deleting and finding.

##Installation Installation with pip is recommended:

pip install rangedict

About

python range dict

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages