Skip to content

Instantly share code, notes, and snippets.

View nickolaskraus-wf's full-sized avatar

Nickolas Kraus nickolaskraus-wf

  • Workiva
  • Ames, IA
View GitHub Profile
@nickolaskraus-wf
nickolaskraus-wf / make_serializable.py
Last active July 7, 2022 20:45
Given a list of arguments, return their JSON serializable equivalents
from typing import Any, Union
import json
def make_serializable_helper(x: Union[dict, list]) -> Union[dict, list]:
"""
Given a list or dict, return its JSON serializable equivalent.
"""
if len(x) == 0: