def _flatten(self, obj):
    if (PY2 and isinstance(obj, types.FileType)):
        return self._flatten_file(obj)
    if util.is_bytes(obj):
        return self._flatten_bytestring(obj)
    if util.is_primitive(obj):
        return obj
    if (self._use_decimal and isinstance(obj, decimal.Decimal)):
        return obj
    self._push()
    return self._pop(self._flatten_obj(obj))
def _flatten(self, obj):
    if (PY2 and isinstance(obj, types.FileType)):
        return self._flatten_file(obj)
    if util.is_bytes(obj):
        return self._flatten_bytestring(obj)
    if util.is_primitive(obj):
        return obj
    if (self._use_decimal and isinstance(obj, decimal.Decimal)):
        return obj
    self._push()
    return self._pop(self._flatten_obj(obj))