Skip to main content

is_text_serializer

Python API reference for the function serializer.is_text_serializer.

Public API

Function: is_text_serializer

Canonical path: serializer.is_text_serializer

Declared in: serializer.py

Signature

def is_text_serializer(serializer): ...

Summary

Checks whether a serializer generates text or binary.

Behavior

The function calls the dumps method of the serializer with an empty dictionary and checks if the returned value is a string.

Parameters

  • serializer: The serializer instance to check.

Returns

  • Return value 1: True if the serializer generates text, False otherwise.