Tests of the ``inverted`` function and the ``invertdict``
class. An ``invertdict`` should compare equal to an
ordinary ``dict`` with the same items, and calling
``inverted`` on the ordinary ``dict`` should give the
same result as calling the ``inverted`` method on the
``invertdict``.

    >>> from plib.stdlib import inverted, invertdict
    >>> d1 = {'a': 1, 'b': 2}
    >>> d2 = invertdict(d1)
    >>> d1 == d2
    True
    >>> i1 = inverted(d1)
    >>> i2 = d2.inverted()
    >>> i1 == {1: 'a', 2: 'b'}
    True
    >>> i1 == i2
    True

The ``inverted`` function and the ``inverted`` method
both preserve the actual class of the object, even if
it's a subclass of ``dict`` or ``invertdict``.

    >>> i1.__class__.__name__
    'dict'
    >>> i2.__class__.__name__
    'invertdict'
    >>> class test1(dict):
    ...     pass
    ... 
    >>> class test2(invertdict):
    ...     pass
    ... 
    >>> t1 = test1(d1)
    >>> t2 = test2(d1)
    >>> t1 == t2
    True
    >>> i1 = inverted(t1)
    >>> i2 = t2.inverted()
    >>> i1 == i2
    True
    >>> i1.__class__.__name__
    'test1'
    >>> i2.__class__.__name__
    'test2'
    >>> d3 = {'a': 1, 'b': 2, 'c': 3}
    >>> d4 = invertdict(d3)

Test limiting the keys to be inverted with the ``keylist``
parameter.

    >>> keylist = ['a', 'b']
    >>> i3 = inverted(d3, keylist)
    >>> i4 = d4.inverted(keylist)
    >>> i3 == i1
    True
    >>> i3 == i4
    True
