(self)
return transform_value(dict(self))
Convert a SON document to a normal Python dictionary instance.

        This is trickier than just *dict(...)* because it needs to be
        recursive.
Convert a SON document to a normal Python dictionary instance.
Convert a SON document to a normal Python dictionary instance .
def to_dict(self):
        """Convert a SON document to a normal Python dictionary instance.

        This is trickier than just *dict(...)* because it needs to be
        recursive.
        """

        def transform_value(value):
            if isinstance(value, list):
                return [transform_value(v) for v in value]
            elif isinstance(value, collections.Mapping):
                return dict([
                    (k, transform_value(v))
                    for k, v in iteritems(value)])
            else:
                return value

        return transform_value(dict(self))
def to_dict ( self ) : def transform_value ( value ) : if isinstance ( value , list ) : return [ transform_value ( v ) for v in value ] elif isinstance ( value , collections . Mapping ) : return dict ( [ ( k , transform_value ( v ) ) for k , v in iteritems ( value ) ] ) else : return value return transform_value ( dict ( self ) )