jab/bidict — pull request #1 by brannerchinese (2014-09-25 18:39:47+00:00)
Title: add simple tests and timing code

The tests here may not be much use to you, but typing them out was useful to me in examining the library's workings. There are two files, meant for use with `pytest`:

* `test_docs_content.py` reproduces most of the tests in the docstrings.
* `test_large_lists.py` creates some large lists and tests `inverse` and `get_item` on their instantiations as `bidict`s.

The little timing program shows me how much slower `bidict` is than just creating a reversed dictionary. Of course, creation happens only once, and after that there are considerable savings in space and functionality. I am not suggesting any changes to `bidict` on account of this — I just wanted to see the difference in timing.

```python
>>> import time_manual_reverse_dict as M
>>> M.main(200)
Example with int: str.
In 200 trials, average time for a list of cardinality 100000:
bidict: 1.8498 sec.
reversed dict: 0.0349 sec.

Example with str: int.
In 200 trials, average time for a list of cardinality 100000:
bidict: 1.8675 sec.
reversed dict: 0.0378 sec.
>>>
```