def flatten(self, obj, reset=True):
    "Takes an object and returns a JSON-safe representation of it.\n\n        Simply returns any of the basic builtin datatypes\n\n        >>> p = Pickler()\n        >>> p.flatten('hello world') == 'hello world'\n        True\n        >>> p.flatten(49)\n        49\n        >>> p.flatten(350.0)\n        350.0\n        >>> p.flatten(True)\n        True\n        >>> p.flatten(False)\n        False\n        >>> r = p.flatten(None)\n        >>> r is None\n        True\n        >>> p.flatten(False)\n        False\n        >>> p.flatten([1, 2, 3, 4])\n        [1, 2, 3, 4]\n        >>> p.flatten((1,2,))[tags.TUPLE]\n        [1, 2]\n        >>> p.flatten({'key': 'value'}) == {'key': 'value'}\n        True\n        "
    if reset:
        self.reset()
    return self._flatten(obj)
Takes an object and returns a JSON-safe representation of it.

Simply returns any of the basic builtin datatypes

>>> p = Pickler()
>>> p.flatten('hello world') == 'hello world'
True
>>> p.flatten(49)
49
>>> p.flatten(350.0)
350.0
>>> p.flatten(True)
True
>>> p.flatten(False)
False
>>> r = p.flatten(None)
>>> r is None
True
>>> p.flatten(False)
False
>>> p.flatten([1, 2, 3, 4])
[1, 2, 3, 4]
>>> p.flatten((1,2,))[tags.TUPLE]
[1, 2]
>>> p.flatten({'key': 'value'}) == {'key': 'value'}
True
def flatten(self, obj, reset=True):
    "Takes an object and returns a JSON-safe representation of it.\n\n        Simply returns any of the basic builtin datatypes\n\n        >>> p = Pickler()\n        >>> p.flatten('hello world') == 'hello world'\n        True\n        >>> p.flatten(49)\n        49\n        >>> p.flatten(350.0)\n        350.0\n        >>> p.flatten(True)\n        True\n        >>> p.flatten(False)\n        False\n        >>> r = p.flatten(None)\n        >>> r is None\n        True\n        >>> p.flatten(False)\n        False\n        >>> p.flatten([1, 2, 3, 4])\n        [1, 2, 3, 4]\n        >>> p.flatten((1,2,))[tags.TUPLE]\n        [1, 2]\n        >>> p.flatten({'key': 'value'}) == {'key': 'value'}\n        True\n        "
    if reset:
        self.reset()
    return self._flatten(obj)